/* Premium Authentication Design - Sophisticated & Classy */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    background: #0f172a !important;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Layout adjustments for full-page auth */
.main-wrapper {
    background: transparent;
    min-height: 100vh;
    padding: 0 !important;
    margin: 0 !important;
}

.page-wrapper.full-page {
    width: 100%;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 100vh;
}

.page-content {
    width: 100%;
    min-height: 100vh;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
}

/* Auth Container - Full Width Split Screen */
.auth-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    position: relative;
    z-index: 1;
    padding: 0;
    margin: 0;
}

/* Auth Card - Full Width */
.auth-card {
    width: 100%;
    min-height: 100vh;
    display: flex;
    background: transparent;
    padding: 0;
    margin: 0;
    position: relative;
}

/* Split Screen Background - Left - Corporate Navy */
.auth-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 45%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    z-index: 0;
}

/* Sophisticated Grid Pattern Overlay */
.auth-card::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 45%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
    z-index: 1;
}

/* Left Side - Elegant Logo Section with Background Image */
.auth-header {
    position: relative;
    width: 45%;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    z-index: 2;
    background-image: url('/assets/images/auth.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    color: white;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        inset -1px 0 0 rgba(255, 255, 255, 0.05),
        2px 0 40px rgba(0, 0, 0, 0.2);
    order: 1;
}

/* Sophisticated Overlay */
.auth-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at top left, rgba(35, 87, 154, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(26, 69, 117, 0.15) 0%, transparent 50%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.4) 0%, rgba(30, 41, 59, 0.3) 100%);
    z-index: 1;
    backdrop-filter: blur(2px);
}

.auth-header > * {
    position: relative;
    z-index: 2;
}

/* Premium Logo Container */
.auth-header-logo {
    width: 160px;
    height: 160px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 0.98) 100%);
    border-radius: 50%;
    padding: 2rem;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 10px 25px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 2px 4px rgba(255, 255, 255, 0.8),
        inset 0 -2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.auth-header-logo::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.auth-header-logo:hover::before {
    opacity: 1;
}

.auth-header-logo:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.5),
        0 15px 35px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.15),
        inset 0 2px 4px rgba(255, 255, 255, 1),
        inset 0 -2px 4px rgba(0, 0, 0, 0.05);
}

.auth-header-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* Hide text on left */
.auth-header h1,
.auth-header p {
    display: none;
}

/* Right Side - Formal Corporate Form Section */
.auth-form {
    position: relative;
    width: 55%;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 4rem;
    background: #ffffff;
    z-index: 2;
    box-shadow:
        -8px 0 40px rgba(0, 0, 0, 0.1),
        inset 1px 0 0 rgba(226, 232, 240, 0.8);
    order: 2;
}

/* Professional Subtle Pattern */
.auth-form::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.5) 0%, rgba(255, 255, 255, 0) 100%),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(226, 232, 240, 0.03) 10px,
            rgba(226, 232, 240, 0.03) 20px
        );
    pointer-events: none;
    z-index: 0;
}

.auth-form > * {
    width: 100%;
    max-width: 500px;
    position: relative;
    z-index: 1;
}

/* Hide Logo in Form Section */
.auth-logo-wrapper {
    display: none;
}

.auth-form-logo {
    display: none;
}

/* Formal Corporate Header */
.auth-form-header {
    margin-bottom: 3rem;
    text-align: center;
    padding-bottom: 2rem;
    position: relative;
    border-bottom: 1px solid #e2e8f0;
}

.auth-form-header::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: #23579a;
}

.auth-form-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    letter-spacing: -1px;
    position: relative;
    font-family: 'Inter', 'Segoe UI', -apple-system, sans-serif;
}

.auth-form-header p {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: 0.2px;
}

/* Corporate Professional Alert */
.auth-alert {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-left: 4px solid;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-color: #10b981;
}

.auth-alert svg {
    flex-shrink: 0;
}

.auth-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #ef4444;
}

/* Elegant Form Fields */
.form-field {
    margin-bottom: 1.25rem;
}

.field-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.625rem;
    letter-spacing: 0.02em;
}

.field-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 1.25rem;
    color: #94a3b8;
    pointer-events: none;
    z-index: 2;
    transition: color 0.3s ease;
}

.field-input:focus + .field-icon,
.field-input-wrapper:hover .field-icon {
    color: #23579a;
}

.field-input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3rem;
    font-size: 1rem;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    transition: all 0.25s ease;
    outline: none;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    font-weight: 400;
}

.field-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.field-input:hover {
    border-color: #94a3b8;
    background: #ffffff;
}

.field-input:focus {
    border-color: #23579a;
    background: #ffffff;
    box-shadow:
        0 0 0 3px rgba(35, 87, 154, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.05);
}

.field-input.is-invalid {
    border-color: #ef4444;
    background: #fef2f2;
}

.field-input.is-invalid:focus {
    border-color: #ef4444;
    box-shadow:
        0 0 0 4px rgba(239, 68, 68, 0.15),
        0 8px 20px rgba(239, 68, 68, 0.12);
}

.field-input[readonly] {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

.field-toggle-password {
    position: absolute;
    right: 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 8px;
    z-index: 2;
}

.field-toggle-password:hover {
    color: #23579a;
    background: rgba(35, 87, 154, 0.08);
}

.field-error {
    display: block;
    margin-top: 0.625rem;
    font-size: 0.875rem;
    color: #dc2626;
    font-weight: 600;
}

.field-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

/* Premium Auth Options */
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    padding: 0.25rem 0;
}

.checkbox-wrapper:hover {
    opacity: 0.8;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.625rem;
    cursor: pointer;
    accent-color: #23579a;
    border-radius: 6px;
}

.checkbox-label {
    font-size: 0.9375rem;
    color: #334155;
    font-weight: 500;
}

.auth-link {
    font-size: 0.9375rem;
    color: #23579a;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.auth-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #23579a;
    transition: width 0.3s ease;
}

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

.auth-link:hover {
    color: #1a4575;
}

/* Corporate Professional Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 1.25rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: #23579a;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 12px rgba(35, 87, 154, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

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

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

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 20px rgba(35, 87, 154, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.15);
    background: #1e4a7d;
}

.auth-submit-btn:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(35, 87, 154, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-submit-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.auth-submit-btn:disabled:hover {
    transform: none;
    box-shadow:
        0 4px 12px rgba(35, 87, 154, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Back Link */
.auth-back-link {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-link-back {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.9375rem;
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    background: transparent;
}

.auth-link-back:hover {
    color: #23579a;
    background: rgba(35, 87, 154, 0.06);
}

/* Elegant Footer */
.auth-footer {
    text-align: center;
    padding-top: 1.5rem;
    margin-top: auto;
    position: relative;
}

.auth-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #cbd5e0, transparent);
    border-radius: 2px;
}

.auth-footer p {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.3px;
    padding-top: 1rem;
}

.auth-footer-links {
    margin-top: 1rem;
}

.auth-footer-links a {
    font-size: 0.875rem;
    color: #64748b;
    text-decoration: none;
    margin: 0 0.75rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-footer-links a:hover {
    color: #23579a;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .auth-card::before,
    .auth-card::after {
        width: 40%;
    }

    .auth-header {
        width: 40%;
        padding: 4rem 2.5rem;
    }

    .auth-form {
        width: 60%;
        padding: 4rem 3rem;
    }

    .auth-form-logo {
        max-width: 180px;
    }

    .auth-header-logo {
        width: 150px;
        height: 150px;
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .auth-card {
        flex-direction: column;
    }

    /* Hide left side background on mobile */
    .auth-card::before,
    .auth-card::after {
        display: none;
    }

    /* Hide left side completely on mobile */
    .auth-header {
        display: none;
    }

    /* Form takes full width on mobile */
    .auth-form {
        width: 100%;
        height: auto;
        min-height: 100vh;
        padding: 3rem 2rem;
        box-shadow: none;
    }

    /* Show logo on mobile in form section */
    .auth-logo-wrapper {
        display: flex;
        justify-content: center;
        margin-bottom: 2.5rem;
    }

    .auth-form-logo {
        display: block;
        max-width: 160px;
        height: auto;
    }

    .auth-form-header h2 {
        font-size: 1.875rem;
    }
}

@media (max-width: 640px) {
    .auth-form {
        padding: 2.5rem 1.5rem;
    }

    .auth-form-logo {
        max-width: 140px;
    }

    .auth-form-header h2 {
        font-size: 1.75rem;
    }

    .field-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 1rem 1.25rem 1rem 3rem;
    }

    .auth-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .auth-footer {
        padding-top: 2rem;
    }

    .auth-submit-btn {
        padding: 1.125rem 1.5rem;
        font-size: 0.9375rem;
    }
}

@media (max-width: 480px) {
    .auth-form {
        padding: 2rem 1.25rem;
    }

    .auth-form-logo {
        max-width: 120px;
    }

    .auth-form-header {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }

    .auth-form-header h2 {
        font-size: 1.5rem;
    }

    .auth-form-header p {
        font-size: 0.875rem;
    }

    .auth-logo-wrapper {
        margin-bottom: 2rem;
    }

    .field-label {
        font-size: 0.875rem;
    }

    .auth-submit-btn {
        padding: 1rem 1.25rem;
        font-size: 0.875rem;
    }
}
