/**********************************************
    AIsle Authentication Pages — Purple & Gold Design
    Matches logo_v1_purple.png aesthetic
**********************************************/

/* === CSS VARIABLES (Purple & Gold Palette) === */
:root {
    /* Primary Purple Palette */
    --primary: #2D1B4E;
    --primary-dark: #1F1238;
    --primary-light: #4A2D6B;
    --primary-muted: #5C4178;

    /* Gold Accent Palette */
    --gold: #C9A44C;
    --gold-dark: #A88A3D;
    --gold-light: #E8D5B7;
    --gold-shimmer: #D4B65C;

    /* Secondary Colors */
    --secondary: #9B7BB8;
    --lavender: #9B7BB8;
    --lavender-light: #C4B0D6;

    /* Text Colors */
    --navy: #2D1B4E;
    --text-primary: #2D1B4E;
    --text-secondary: #5C4178;
    --text-muted: #8A7C9E;

    /* Background Colors */
    --light-rose: rgba(155, 123, 184, 0.2);
    --bg-light: #F8F5F0;
    --bg-cream: #FFFDF9;
    --white: #ffffff;

    /* Semantic Colors */
    --success: #2f7a4f;
    --success-light: rgba(47, 122, 79, 0.1);
    --error: #c53030;
    --error-light: rgba(197, 48, 48, 0.1);
    --warning: #C9A44C;
    --warning-light: rgba(201, 164, 76, 0.1);

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --shadow-sm: 0 2px 8px rgba(45, 27, 78, 0.08);
    --shadow-md: 0 4px 20px rgba(45, 27, 78, 0.12);
    --shadow-lg: 0 8px 40px rgba(45, 27, 78, 0.16);
    --shadow-glow: 0 0 40px rgba(201, 164, 76, 0.25);
    --shadow-input-focus: 0 0 0 3px rgba(45, 27, 78, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 32px;

    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* === BASE STYLES === */
.auth-page {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 40%, var(--primary-light) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.auth-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top right, rgba(201, 164, 76, 0.15) 0%, transparent 50%),
                radial-gradient(ellipse at bottom left, rgba(155, 123, 184, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.auth-page h1,
.auth-page h2,
.auth-page h3,
.auth-page h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
}

/* === AUTH HEADER === */
.auth-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(224, 224, 224, 0.4);
    transition: var(--transition-base);
}

.auth-header.scrolled {
    box-shadow: var(--shadow-sm);
}

.auth-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.auth-header .logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.auth-header .logo-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}
.auth-header .logo-tagline {
    font-family: 'Great Vibes', cursive;
    font-size: 1rem;
    color: #C9A86A;
    line-height: 1.2;
}
.auth-header .logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: #C9A86A;
    background: var(--brand-gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.auth-header .header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auth-header .back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 10px 16px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-header .back-link:hover {
    color: var(--primary);
}

.auth-header .back-link svg {
    width: 16px;
    height: 16px;
}

.auth-header .alt-auth-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--gold-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    transition: var(--transition-base);
    box-shadow: 0 2px 8px rgba(45, 27, 78, 0.25);
}

.auth-header .alt-auth-btn:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 27, 78, 0.35);
}

/* === MAIN AUTH CONTAINER === */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 60px;
}

/* === AUTH CARD === */
.auth-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    padding: 48px;
    animation: slideUp 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--primary), var(--gold));
}

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

/* === AUTH CARD HEADER === */
.auth-card-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-card-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(201, 164, 76, 0.15) 0%, rgba(155, 123, 184, 0.15) 100%);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 16px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1px solid rgba(201, 164, 76, 0.3);
}

.auth-card-header h1 {
    font-size: 1.75rem;
    color: var(--navy);
    margin-bottom: 8px;
}

.auth-card-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* === FORM STYLES === */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Form Group */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-label .required {
    color: var(--error);
}

/* Input Wrapper (for icons and password toggle) */
.input-wrapper {
    position: relative;
}

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

.input-wrapper.has-icon input {
    padding-left: 44px;
}

.input-wrapper.has-icon .form-select {
    padding-left: 44px;
}

.input-wrapper .password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.input-wrapper .password-toggle:hover {
    color: var(--primary);
}

.input-wrapper .password-toggle svg {
    width: 20px;
    height: 20px;
}

/* Input Styles */
.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--white);
    border: 2px solid var(--light-rose);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition-base);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:hover {
    border-color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-input-focus);
}

/* Input States */
.form-input.valid {
    border-color: var(--success);
}

.form-input.valid:focus {
    box-shadow: 0 0 0 3px rgba(47, 122, 79, 0.15);
}

.form-input.invalid {
    border-color: var(--error);
}

.form-input.invalid:focus {
    box-shadow: 0 0 0 3px rgba(197, 48, 48, 0.15);
}

/* Validation Icon in Input */
.input-wrapper .validation-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    opacity: 0;
    transition: var(--transition-fast);
}

.input-wrapper.has-password-toggle .validation-icon {
    right: 44px;
}

.input-wrapper .validation-icon.show {
    opacity: 1;
}

.input-wrapper .validation-icon.valid {
    color: var(--success);
}

.input-wrapper .validation-icon.invalid {
    color: var(--error);
}

/* Select Styles */
.form-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--white);
    border: 2px solid var(--light-rose);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition-base);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238A7C79' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 44px;
}

.form-select:hover {
    border-color: var(--text-muted);
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-input-focus);
}

/* === PASSWORD STRENGTH METER === */
.password-strength {
    margin-top: 8px;
}

.strength-bar-container {
    height: 6px;
    background: var(--light-rose);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}

.strength-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-bar.weak {
    width: 25%;
    background: var(--error);
}

.strength-bar.fair {
    width: 50%;
    background: var(--warning);
}

.strength-bar.good {
    width: 75%;
    background: #5a9a6a;
}

.strength-bar.strong {
    width: 100%;
    background: var(--success);
}

.strength-text {
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.strength-label {
    color: var(--text-muted);
}

.strength-value {
    font-weight: 600;
}

.strength-value.weak { color: var(--error); }
.strength-value.fair { color: var(--warning); }
.strength-value.good { color: #5a9a6a; }
.strength-value.strong { color: var(--success); }

/* === REMEMBER ME / FORGOT PASSWORD ROW === */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -4px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.remember-me span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.forgot-password {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

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

/* === SUBMIT BUTTON === */
.auth-submit-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-body);
    color: #fff;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-base);
    box-shadow: 0 4px 15px rgba(201, 164, 76, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.auth-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.auth-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 164, 76, 0.45);
    background: linear-gradient(135deg, var(--gold-shimmer) 0%, var(--gold) 100%);
}

.auth-submit-btn:hover:not(:disabled)::before {
    left: 100%;
}

.auth-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

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

.auth-submit-btn .btn-text {
    transition: opacity 0.2s ease;
}

.auth-submit-btn.loading .btn-text {
    opacity: 0;
}

.auth-submit-btn .btn-spinner {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(45, 27, 78, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    opacity: 0;
}

.auth-submit-btn.loading .btn-spinner {
    opacity: 1;
}

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

/* === ERROR MESSAGE === */
.form-error {
    display: none;
    padding: 12px 16px;
    background: var(--error-light);
    border: 1px solid var(--error);
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: 0.875rem;
    font-weight: 500;
    animation: shake 0.4s ease;
}

.form-error.show {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-error svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* === SUCCESS MESSAGE === */
.form-success {
    display: none;
    padding: 12px 16px;
    background: var(--success-light);
    border: 1px solid var(--success);
    border-radius: var(--radius-sm);
    color: var(--success);
    font-size: 0.875rem;
    font-weight: 500;
}

.form-success.show {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-success svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* === FIELD ERROR MESSAGE === */
.field-error {
    font-size: 0.75rem;
    color: var(--error);
    margin-top: 4px;
    display: none;
}

.field-error.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

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

/* === AUTH CARD FOOTER === */
.auth-card-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--light-rose);
    text-align: center;
}

.auth-card-footer p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-card-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.auth-card-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* === DECORATIVE ELEMENTS === */
.auth-decoration {
    position: fixed;
    pointer-events: none;
    z-index: 0;
}

.auth-decoration.top-right {
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(201, 164, 76, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.auth-decoration.bottom-left {
    bottom: -150px;
    left: -150px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(155, 123, 184, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

/* === SOCIAL LOGIN (future) === */
.social-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.social-divider::before,
.social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--light-rose);
}

.social-divider span {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .auth-header-container {
        padding: 12px 16px;
    }

    .auth-header .logo img {
        width: 40px;
        height: 40px;
    }

    .auth-header .logo-text {
        font-size: 1.25rem;
    }

    .auth-header .back-link span {
        display: none;
    }

    .auth-container {
        padding: 80px 16px 40px;
    }

    .auth-card {
        padding: 32px 24px;
        border-radius: var(--radius-lg);
    }

    .auth-card-header h1 {
        font-size: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .auth-header .header-actions {
        gap: 8px;
    }

    .auth-header .alt-auth-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .auth-card {
        padding: 24px 20px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .auth-submit-btn {
        padding: 14px 20px;
    }
}

/* === SMOOTH SCROLL === */
html {
    scroll-behavior: smooth;
}
