/* Authentication Pages Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --success: #10b981;
    --danger: #ef4444;
    --dark: #1f2937;
    --gray: #6b7280;
    --light: #f9fafb;
    --white: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Auth Container */
.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* Form Section */
.auth-form-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--white);
}

.auth-form-wrapper {
    width: 100%;
    max-width: 450px;
}

.auth-form-wrapper.register-form {
    max-width: 550px;
}

.auth-logo h1 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 2rem;
    font-weight: 700;
}

.auth-header {
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--gray);
    font-size: 1rem;
}

/* Alert */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-error {
    background: #fee2e2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
    font-weight: 500;
}

.alert i {
    font-size: 1.25rem;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
    font-size: 0.875rem;
}

.form-group label i {
    font-size: 1.125rem;
    color: var(--primary);
}

.form-group input,
.form-group select {
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s;
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.password-input {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input input {
    width: 100%;
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray);
    font-size: 1.25rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    transition: color 0.3s;
}

.toggle-password:hover {
    color: var(--primary);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--dark);
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: var(--white);
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--gray);
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.btn-block {
    width: 100%;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--gray);
    font-size: 0.875rem;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--gray);
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.divider span {
    padding: 0 1rem;
}

/* Brand Section */
.auth-brand-section {
    position: relative;
    background: linear-gradient(135deg, rgba(14,165,233,0.85) 0%, rgba(37,99,235,0.90) 100%);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    overflow: hidden;
}

/* Blue gradient overlay — always on top of the background image */
.auth-brand-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(14,165,233,0.85) 0%, rgba(37,99,235,0.90) 100%);
    z-index: 1;
}

/* Admin login — purple/pink gradient */
.auth-brand-admin::after {
    background: linear-gradient(135deg, rgb(215 14 233 / 85%) 0%, rgb(145 9 229 / 90%) 100%) !important;
}

.auth-brand-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    z-index: 2;
}

.brand-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: var(--white);
    max-width: 500px;
}

.brand-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(80px);
    z-index: 3;
    filter: blur(80px);
}

.brand-text {
    position: relative;
    z-index: 2;
}

.brand-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.brand-text p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
}

.brand-feature i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .auth-container {
        grid-template-columns: 1fr;
    }
    
    .auth-brand-section {
        display: none;
    }
    
    /* Mobile: full-page with gradient/image header */
    .auth-form-section {
        min-height: 100vh;
        align-items: flex-start;
        padding: 0;
        background: #f1f5f9;
        flex-direction: column;
    }

    /* Image/gradient banner at top */
    .auth-mobile-banner {
        display: flex !important;
        width: 100%;
        height: 200px;
        background: var(--mobile-bg-image, linear-gradient(135deg, rgba(14,165,233,0.9) 0%, rgba(37,99,235,0.95) 100%));
        background-size: cover;
        background-position: center top;
        align-items: center;
        justify-content: center;
        position: relative;
        flex-shrink: 0;
    }

    /* Fade wave at bottom of banner */
    .auth-mobile-banner::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 400px;
        background: linear-gradient(to bottom, transparent, #4b93db);
    }

    .auth-mobile-banner .auth-logo {
        position: relative;
        z-index: 2;
        margin: 0;
    }

    .auth-mobile-banner .auth-logo h1 {
        color: #fff !important;
        font-size: 2.2rem !important;
        background: none !important;
        -webkit-text-fill-color: #fff !important;
        text-shadow: 0 2px 16px rgba(0,0,0,0.3);
    }

    /* Card form below banner */
    .auth-form-wrapper {
        width: 100%;
        max-width: 100%;
        background: #fff;
        border-radius: 20px 20px 0 0;
        padding: 2rem 1.5rem 3rem;
        margin-top: -20px;
        position: relative;
        z-index: 2;
        box-shadow: 0 -4px 30px rgba(0,0,0,0.07);
        flex: 1;
    }

    /* Hide logo inside form wrapper on mobile (it's in the banner) */
    .auth-form-wrapper > .auth-logo {
        display: none;
    }
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .auth-header h2 {
        font-size: 1.5rem;
    }
    
    .form-options {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
}

/* ── Admin login purple theme ─────────────────────────── */
.admin-login-page {
    --primary:       #9009e5;
    --primary-dark:  #6d07b0;
    --primary-light: #b03af0;
}

/* Admin mobile banner uses purple gradient */
.auth-mobile-banner-admin {
    background: linear-gradient(135deg, rgba(215,14,233,0.9) 0%, rgba(145,9,229,0.95) 100%) !important;
}

.auth-mobile-banner-admin::after {
    background: linear-gradient(to bottom, transparent, #f1f5f9) !important;
}

.admin-login-page .form-group input:focus,
.admin-login-page .form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(144, 9, 229, 0.12);
}

.admin-login-page .btn-primary {
    background: linear-gradient(135deg, #d70ee9 0%, #9109e5 100%);
}
.admin-login-page .btn-primary:hover {
    background: linear-gradient(135deg, #b80cc7 0%, #7007c0 100%);
}

.admin-login-page .link,
.admin-login-page .toggle-password:hover {
    color: var(--primary);
}
.admin-login-page .link:hover {
    color: var(--primary-dark);
}

.admin-login-page .checkbox-label input:checked {
    accent-color: var(--primary);
}

.admin-login-page .auth-logo h1 {
    background: linear-gradient(135deg, #d70ee9, #9109e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
