/*
Theme Name: ADS KHOME Theme
Theme URI: https://ads.khome.asia
Author: Khome.Asia
Description: Theme chỉ dùng để đăng nhập backend
Version: 2.1
*/

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding: 16px;
    overflow: hidden;
    position: relative;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    overflow: hidden;
}

/* Animated Waves */
.wave {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    border-radius: 45%;
    opacity: 0.15;
}

.wave1 {
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.8) 0%, transparent 70%);
    animation: wave 25s infinite linear;
}

.wave2 {
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.6) 0%, transparent 70%);
    animation: wave 20s infinite linear reverse;
    animation-delay: -5s;
}

.wave3 {
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.4) 0%, transparent 70%);
    animation: wave 30s infinite linear;
    animation-delay: -10s;
}

@keyframes wave {
    0% {
        transform: rotate(0deg) scale(1);
    }
    100% {
        transform: rotate(360deg) scale(1.1);
    }
}

/* Floating Particles */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    bottom: -10px;
    animation: float 15s infinite ease-in;
    animation-delay: calc(var(--i) * -1s);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.particles span:nth-child(odd) {
    left: calc(5% * var(--i));
}

.particles span:nth-child(even) {
    right: calc(5% * var(--i));
}

@keyframes float {
    0% {
        transform: translateY(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

/* Login Container */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
}

.login-box {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 40px 32px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 40px rgba(255, 255, 255, 0.1) inset;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shake Animation for Error */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

.shake {
    animation: shake 0.5s;
}

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    margin-bottom: 16px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.logo-icon i {
    font-size: 32px;
    color: #fff;
}

.login-header h1 {
    font-size: 28px;
    color: #1f2937;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-desc {
    color: #6b7280;
    font-size: 15px;
    line-height: 1.5;
}

/* Form Styling */
.login-form {
    margin-bottom: 0;
}

.login-box label {
    display: none;
}

.login-box p {
    margin-bottom: 0;
}

/* Login Message (Error/Success) */
.login-message {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    text-align: center;
}

.login-message i {
    font-size: 16px;
}

.login-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.login-success {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

/* Input Wrapper for Icon */
.login-box p:has(input[type="text"]),
.login-box p:has(input[type="password"]) {
    position: relative;
    margin-bottom: 12px;
}

/* Input Styling - Font size 16px to prevent iOS zoom */
.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    padding: 13px 16px;
    padding-left: 44px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    font-size: 16px;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
}

.login-box input[type="text"]:focus,
.login-box input[type="password"]:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background-color: #fff;
}

.login-box input[type="text"]::placeholder,
.login-box input[type="password"]::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* Input Icons */
.login-box input[type="text"]::before,
.login-box input[type="password"]::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
}

/* Remember Me Checkbox */
.login-box .login-remember {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.login-box .login-remember label {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
    user-select: none;
}

.login-box .login-remember input[type="checkbox"] {
    margin: 0 10px 0 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
    border-radius: 4px;
}

/* Submit Button */
.login-box .login-submit {
    margin-bottom: 0;
}

.login-box .login-submit input {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.login-box .login-submit input:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.login-box .login-submit input:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.login-box .login-submit input:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.login-footer a i {
    font-size: 13px;
}

.login-footer a:hover {
    color: #764ba2;
    gap: 8px;
}

/* Password Toggle Icon */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #9ca3af;
    font-size: 16px;
    padding: 4px;
    transition: color 0.2s ease;
    z-index: 10;
}

.password-toggle:hover {
    color: #667eea;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    body {
        padding: 16px;
    }
    
    .login-box {
        padding: 32px 24px;
        border-radius: 18px;
    }
    
    .logo-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 12px;
    }
    
    .logo-icon i {
        font-size: 28px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .login-desc {
        font-size: 14px;
    }
    
    .login-box input[type="text"],
    .login-box input[type="password"] {
        padding: 12px 16px 12px 42px;
    }
    
    .login-box .login-submit input {
        padding: 13px 16px;
    }
    
    .login-message {
        font-size: 13px;
        padding: 10px 14px;
    }
}

/* Landscape Mobile */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        padding: 12px;
        align-items: flex-start;
    }
    
    .login-box {
        margin: 12px auto;
        padding: 24px 28px;
    }
    
    .logo-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 8px;
    }
    
    .logo-icon i {
        font-size: 24px;
    }
    
    .login-header h1 {
        font-size: 22px;
        margin-bottom: 6px;
    }
    
    .login-desc {
        font-size: 13px;
    }
    
    .login-header {
        margin-bottom: 20px;
    }
    
    .login-box input[type="text"],
    .login-box input[type="password"],
    .login-box .login-submit input {
        padding: 10px 14px 10px 40px;
    }
    
    .login-box .login-remember {
        margin-bottom: 12px;
    }
    
    .login-footer {
        margin-top: 16px;
        padding-top: 16px;
    }
    
    .login-message {
        font-size: 12px;
        padding: 8px 12px;
        margin-bottom: 12px;
    }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 768px) {
    .login-container {
        max-width: 460px;
    }
    
    .login-box {
        padding: 42px 36px;
    }
}

/* Desktop Large */
@media (min-width: 1200px) {
    .login-container {
        max-width: 480px;
    }
    
    .login-box {
        padding: 48px 40px;
    }
}
