/* =====================================================
   MiATech Auth Pages - Premium Login / Register
   Split-panel layout · Glassmorphism · Micro-animations
   ===================================================== */

/* ===== Override main layout for auth pages ===== */
body.auth-page {
    background: var(--bg-body);
    overflow-x: hidden;
}

body.auth-page .main-content {
    min-height: auto;
    padding: 0;
}

/* ===== Auth Section — Full-Width Split ===== */
.auth-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: 40px 16px;
    position: relative;
}

/* Subtle animated gradient background */
.auth-section::before {
    content: '';
    position: absolute;
    top: -120px;
    left: -80px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(238,77,45,0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: authFloat 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.auth-section::after {
    content: '';
    position: absolute;
    bottom: -80px;
    right: -60px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,115,55,0.06) 0%, transparent 70%);
    border-radius: 50%;
    animation: authFloat 10s ease-in-out infinite reverse;
    pointer-events: none;
    z-index: 0;
}

@keyframes authFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(1.05); }
}

/* ===== Auth Container — Split Panel ===== */
.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 960px;
    width: 100%;
    min-height: 560px;
    background: var(--bg-card);
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 25px 60px rgba(0,0,0,0.08),
        0 8px 20px rgba(0,0,0,0.04),
        0 0 0 1px rgba(0,0,0,0.03);
    position: relative;
    z-index: 1;
    animation: authCardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes authCardIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== Left Panel — Brand Showcase ===== */
.auth-brand-panel {
    background: var(--primary-gradient);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
}

/* Decorative circles */
.auth-brand-panel::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.auth-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 160px;
    height: 160px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.auth-brand-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.auth-brand-icon {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 36px;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    animation: authIconPulse 3s ease-in-out infinite;
}

@keyframes authIconPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0.2); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(255,255,255,0); }
}

.auth-brand-name {
    font-size: 32px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.auth-brand-slogan {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    margin-bottom: 32px;
}

.auth-brand-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
    width: 100%;
    max-width: 260px;
}

.auth-brand-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    font-weight: 500;
}

.auth-brand-feature i {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

/* ===== Right Panel — Form ===== */
.auth-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 44px;
    overflow-y: auto;
}

.auth-form-header {
    margin-bottom: 28px;
}

.auth-form-header .auth-greeting {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-form-header .auth-greeting i {
    font-size: 14px;
}

.auth-form-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}

.auth-form-header p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== Form Controls ===== */
.auth-form .form-group {
    margin-bottom: 20px;
    position: relative;
}

.auth-form .form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 0.1px;
}

.auth-form .form-label .required {
    color: var(--primary);
    margin-left: 2px;
}

.auth-form .form-control {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    background: var(--bg-body);
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-form .form-control::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.auth-form .form-control:hover {
    background: #ebedf1;
}

.auth-form .form-control:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(238,77,45,0.08);
}

/* Input icon wrapper */
.auth-input-wrapper {
    position: relative;
}

.auth-input-wrapper .form-control {
    padding-left: 44px;
}

.auth-input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    transition: color var(--transition-fast);
    pointer-events: none;
}

.auth-input-wrapper .form-control:focus ~ .input-icon,
.auth-input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

/* Password toggle */
.auth-password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
    background: none;
    border: none;
    z-index: 2;
}

.auth-password-toggle:hover {
    color: var(--text-primary);
}

/* Form row — 2 cols for register */
.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ===== Submit Button ===== */
.auth-submit-btn {
    width: 100%;
    height: 50px;
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-top: 4px;
}

.auth-submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(238,77,45,0.35);
}

.auth-submit-btn:hover::before {
    opacity: 1;
}

.auth-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(238,77,45,0.25);
}

.auth-submit-btn i {
    font-size: 16px;
    transition: transform 0.3s;
}

.auth-submit-btn:hover i {
    transform: translateX(3px);
}

/* ===== Divider ===== */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.auth-divider span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Social Login ===== */
.auth-social-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 46px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: 2px solid var(--border-color);
    background: #fff;
    color: var(--text-primary);
}

.auth-social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.auth-social-btn.btn-google:hover {
    border-color: #ea4335;
    background: #fff5f4;
}

.auth-social-btn.btn-facebook:hover {
    border-color: #1877f2;
    background: #f0f5ff;
}

.auth-social-btn img {
    width: 20px;
    height: 20px;
}

.auth-social-btn .fa-facebook-f {
    color: #1877f2;
    font-size: 18px;
}

/* ===== Footer Link ===== */
.auth-footer-link {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer-link a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
}

.auth-footer-link a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition-normal);
    border-radius: 2px;
}

.auth-footer-link a:hover::after {
    width: 100%;
}

.auth-footer-link a:hover {
    color: var(--primary-dark);
}

/* ===== Stagger Animations ===== */
.auth-form .form-group,
.auth-submit-btn,
.auth-divider,
.auth-social-group,
.auth-footer-link {
    animation: authFieldIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-form .form-group:nth-child(1) { animation-delay: 0.1s; }
.auth-form .form-group:nth-child(2) { animation-delay: 0.15s; }
.auth-form .form-group:nth-child(3) { animation-delay: 0.2s; }
.auth-form .form-group:nth-child(4) { animation-delay: 0.25s; }
.auth-form .form-group:nth-child(5) { animation-delay: 0.3s; }
.auth-form .form-group:nth-child(6) { animation-delay: 0.35s; }
.auth-submit-btn { animation-delay: 0.35s; }
.auth-divider { animation-delay: 0.4s; }
.auth-social-group { animation-delay: 0.45s; }
.auth-footer-link { animation-delay: 0.5s; }

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

/* ===== Remember & Forgot ===== */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    margin-top: -8px;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.auth-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    border-radius: 4px;
}

.auth-forgot {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.auth-forgot:hover {
    color: var(--primary-dark);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .auth-section {
        padding: 20px 12px;
        min-height: calc(100vh - 280px);
    }

    .auth-container {
        grid-template-columns: 1fr;
        max-width: 440px;
        min-height: auto;
        border-radius: 20px;
    }

    .auth-brand-panel {
        display: none;
    }

    .auth-form-panel {
        padding: 32px 24px;
    }

    .auth-form-header h1 {
        font-size: 22px;
    }

    .auth-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-social-group {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .auth-submit-btn {
        height: 46px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .auth-form-panel {
        padding: 24px 18px;
    }

    .auth-form .form-control {
        height: 44px;
        font-size: 13px;
    }

    .auth-social-btn {
        height: 42px;
        font-size: 13px;
    }
}

/* ===== Mobile brand strip (shows on mobile instead of panel) ===== */
.auth-mobile-brand {
    display: none;
    text-align: center;
    padding: 20px 20px 0;
}

.auth-mobile-brand .mobile-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 4px;
}

.auth-mobile-brand .mobile-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.auth-mobile-brand .mobile-logo-name {
    font-size: 22px;
    font-weight: 900;
    color: var(--primary);
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .auth-mobile-brand {
        display: block;
    }
}
