/* ==========================================================================
   EmailX Modern Authentication Styling
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --auth-font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --auth-primary: #2563eb;
    --auth-primary-hover: #1d4ed8;
    --auth-primary-glow: rgba(37, 99, 235, 0.25);
    --auth-secondary: #06b6d4;
    --auth-accent-gradient: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    --auth-accent-gradient-hover: linear-gradient(135deg, #1d4ed8 0%, #0891b2 100%);
    --auth-bg-dark: #090e1a;
    --auth-bg-dark-card: rgba(15, 23, 42, 0.75);
    --auth-bg-light: #f8fafc;
    --auth-card-bg: #ffffff;
    --auth-text-main: #0f172a;
    --auth-text-muted: #64748b;
    --auth-text-light: #94a3b8;
    --auth-border: #e2e8f0;
    --auth-border-focus: #3b82f6;
    --auth-error: #ef4444;
    --auth-error-bg: #fef2f2;
    --auth-error-border: #fecaca;
    --auth-success: #10b981;
    --auth-success-bg: #ecfdf5;
    --auth-success-border: #a7f3d0;
    --auth-radius-sm: 8px;
    --auth-radius-md: 12px;
    --auth-radius-lg: 16px;
    --auth-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --auth-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --auth-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --auth-shadow-btn: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
    --auth-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body.auth-body {
    font-family: var(--auth-font-family);
    background-color: var(--auth-bg-light);
    color: var(--auth-text-main);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Main Layout Structure
   ========================================================================== */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    background: #ffffff;
}

/* ==========================================================================
   Left Showcase / Hero Pane
   ========================================================================== */
.auth-hero-pane {
    flex: 0 0 44%;
    max-width: 44%;
    background: var(--auth-bg-dark);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3.5rem 3rem;
    color: #ffffff;
    overflow: hidden;
    z-index: 1;
}

/* Background Glowing Orbs & Tech Grid */
.auth-hero-pane::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(37, 99, 235, 0.35) 0%, transparent 40%),
        radial-gradient(circle at 85% 75%, rgba(6, 182, 212, 0.25) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

.auth-hero-pane::after {
    content: '';
    position: absolute;
    inset: 0;
    background-size: 32px 32px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    z-index: -1;
    pointer-events: none;
}

.hero-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hero-brand img.brand-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: var(--auth-transition);
}

.hero-brand-tag {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 3px 10px;
    border-radius: 9999px;
}

/* Center Content & Headlines */
.hero-content {
    margin: auto 0;
    max-width: 480px;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.8125rem;
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 1.5rem;
}

.hero-badge .pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    color: #ffffff;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.hero-title span.gradient-text {
    background: linear-gradient(135deg, #60a5fa 0%, #22d3ee 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: 1rem;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 2.25rem;
}

/* Feature Showcase Cards */
.hero-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--auth-radius-md);
    transition: var(--auth-transition);
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.feature-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
}

.feature-item:nth-child(2) .feature-icon-box {
    background: rgba(6, 182, 212, 0.2);
    color: #22d3ee;
}

.feature-item:nth-child(3) .feature-icon-box {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.feature-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #e2e8f0;
}

.hero-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: #64748b;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 1.5rem;
    margin-top: 2rem;
}

.hero-footer a {
    color: #94a3b8;
    text-decoration: none;
    transition: var(--auth-transition);
}

.hero-footer a:hover {
    color: #ffffff;
}

/* ==========================================================================
   Right Form / Auth Pane
   ========================================================================== */
.auth-form-pane {
    flex: 1 1 56%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background: #ffffff;
    position: relative;
}

.auth-form-container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

/* Mobile Brand Header (Hidden on Desktop) */
.mobile-brand-header {
    display: none;
    text-align: center;
    margin-bottom: 2rem;
}

.mobile-brand-header img {
    height: 40px;
    width: auto;
}

/* Back Link Row */
.auth-back-row {
    margin-bottom: 1.5rem;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-text-muted);
    text-decoration: none;
    transition: var(--auth-transition);
}

.auth-back-link:hover {
    color: var(--auth-primary);
    transform: translateX(-3px);
}

/* Form Header */
.auth-header {
    margin-bottom: 2rem;
}

.auth-header .auth-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--auth-text-main);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.auth-header .auth-subtitle {
    font-size: 0.9375rem;
    color: var(--auth-text-muted);
    font-weight: 400;
    line-height: 1.5;
}

/* Alerts & Notifications */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--auth-radius-md);
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease-out;
}

.auth-alert-danger {
    background-color: var(--auth-error-bg);
    border: 1px solid var(--auth-error-border);
    color: #b91c1c;
}

.auth-alert-success {
    background-color: var(--auth-success-bg);
    border: 1px solid var(--auth-success-border);
    color: #065f46;
}

.auth-alert-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-alert-content {
    flex: 1;
    font-weight: 500;
}

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

/* Form Groups */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Modern Input Container with Icons */
.input-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-icon-prefix {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: var(--auth-transition);
    z-index: 2;
}

.auth-input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 44px;
    font-family: var(--auth-font-family);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--auth-text-main);
    background: #ffffff;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    outline: none;
    transition: var(--auth-transition);
}

.auth-input.has-suffix {
    padding-right: 46px;
}

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

.auth-input:hover {
    border-color: #cbd5e1;
}

.auth-input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px var(--auth-primary-glow);
    background: #ffffff;
}

.auth-input:focus ~ .input-icon-prefix {
    color: var(--auth-primary);
}

.auth-input:disabled,
.auth-input[readonly] {
    background-color: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

/* Password Toggle Button */
.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--auth-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--auth-transition);
    z-index: 3;
}

.password-toggle-btn:hover {
    color: #475569;
    background: #f1f5f9;
}

.password-toggle-btn:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 1px;
}

/* Validation Errors */
.field-validation-error,
.text-danger {
    font-size: 0.8125rem;
    color: var(--auth-error);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.input-validation-error {
    border-color: var(--auth-error) !important;
    background-color: #fffbfa;
}

.input-validation-error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15) !important;
}

/* Options Bar: Remember Me & Forgot Password */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

/* Custom Checkbox */
.custom-checkbox-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.custom-checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-checkbox-mark {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: #ffffff;
    border: 1.5px solid var(--auth-border);
    border-radius: 5px;
    transition: var(--auth-transition);
    margin-right: 10px;
    flex-shrink: 0;
}

.custom-checkbox-wrapper:hover input ~ .custom-checkbox-mark {
    border-color: #94a3b8;
}

.custom-checkbox-wrapper input:checked ~ .custom-checkbox-mark {
    background-color: var(--auth-primary);
    border-color: var(--auth-primary);
}

.custom-checkbox-wrapper input:focus-visible ~ .custom-checkbox-mark {
    box-shadow: 0 0 0 3px var(--auth-primary-glow);
}

.custom-checkbox-mark::after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox-wrapper input:checked ~ .custom-checkbox-mark::after {
    display: block;
}

.checkbox-label-text {
    font-size: 0.875rem;
    color: #475569;
    font-weight: 500;
}

/* Forgot Password Link */
.forgot-password-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-primary);
    text-decoration: none;
    transition: var(--auth-transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.forgot-password-link:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: var(--auth-radius-md);
    background: var(--auth-accent-gradient);
    color: #ffffff;
    font-family: var(--auth-font-family);
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    cursor: pointer;
    box-shadow: var(--auth-shadow-btn);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--auth-transition);
    position: relative;
    overflow: hidden;
}

.auth-submit-btn:hover {
    background: var(--auth-accent-gradient-hover);
    box-shadow: 0 12px 24px -4px rgba(37, 99, 235, 0.45);
    transform: translateY(-2px);
}

.auth-submit-btn:active {
    transform: translateY(0);
    box-shadow: var(--auth-shadow-sm);
}

.auth-submit-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--auth-primary-glow);
}

/* Secondary Button / Cancel */
.auth-secondary-btn {
    width: 100%;
    height: 48px;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    background: #ffffff;
    color: var(--auth-text-muted);
    font-family: var(--auth-font-family);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--auth-transition);
}

.auth-secondary-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--auth-text-main);
    text-decoration: none;
}

/* Shimmer Highlight Effect on Button */
.auth-submit-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: rotate(30deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.auth-submit-btn:hover::after {
    opacity: 1;
    transform: rotate(30deg) translate(50%, 50%);
}

.auth-submit-btn .btn-arrow-icon {
    transition: var(--auth-transition);
}

.auth-submit-btn:hover .btn-arrow-icon {
    transform: translateX(4px);
}

/* Button Loading State */
.auth-submit-btn.btn-loading {
    pointer-events: none;
    opacity: 0.85;
}

.auth-submit-btn .btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.auth-submit-btn.btn-loading .btn-text,
.auth-submit-btn.btn-loading .btn-arrow-icon {
    display: none;
}

.auth-submit-btn.btn-loading .btn-spinner {
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Auth Footer */
.auth-footer-area {
    margin-top: 2.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.powered-by-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--auth-text-muted);
    font-weight: 500;
}

.powered-by-box img {
    height: 18px;
    width: auto;
    object-fit: contain;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--auth-text-light);
    font-weight: 500;
}

.security-badge svg {
    color: var(--auth-success);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1100px) {
    .auth-hero-pane {
        flex: 0 0 40%;
        max-width: 40%;
        padding: 2.5rem 2rem;
    }
    .hero-title {
        font-size: 1.85rem;
    }
}

@media (max-width: 900px) {
    .auth-wrapper {
        flex-direction: column;
    }
    .auth-hero-pane {
        flex: none;
        max-width: 100%;
        width: 100%;
        padding: 2.5rem 1.75rem;
        min-height: auto;
    }
    .hero-content {
        margin: 1.5rem 0;
    }
    .hero-features {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    .hero-footer {
        display: none;
    }
    .auth-form-pane {
        flex: 1 1 auto;
        padding: 2.5rem 1.5rem 3rem;
    }
}

@media (max-width: 600px) {
    .auth-hero-pane {
        display: none;
    }
    .mobile-brand-header {
        display: block;
    }
    .auth-form-pane {
        padding: 2rem 1.25rem 2.5rem;
        background: #f8fafc;
        min-height: 100vh;
        align-items: flex-start;
        padding-top: 3rem;
    }
    .auth-form-container {
        background: #ffffff;
        padding: 2rem 1.5rem;
        border-radius: var(--auth-radius-lg);
        box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
        border: 1px solid var(--auth-border);
    }
    .auth-header .auth-title {
        font-size: 1.6rem;
    }
    .auth-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .forgot-password-link {
        margin-left: 28px;
    }
}
