/* --- CSS Variables & Theming --- */
:root {
    --bg-dark: #090d1a;            /* Match Invertase logo background color */
    --bg-darker: #04060d;          /* Darker shade for radial gradient */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;      /* Sleek silver-gray */
    --text-muted: #64748b;
    
    /* Gold & Amber Brand Accents */
    --gold-primary: #e2b83b;       /* Premium gold color */
    --gold-bright: #f59e0b;        /* Bright Amber for highlights */
    --gold-hover: #fbbf24;
    --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #b8860b 100%);
    --gold-glow: rgba(245, 158, 11, 0.15);
    
    /* Glassmorphic values */
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-bg-hover: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(212, 175, 55, 0.08); /* Subtle gold tint in border */
    --glass-border-hover: rgba(212, 175, 55, 0.18);
    
    /* Atmospheric Glow */
    --glow-primary: rgba(226, 184, 59, 0.06);   /* Warm gold glow */
    --glow-secondary: rgba(245, 158, 11, 0.05); /* Warm amber glow */
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Accessibility & SEO utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Atmospheric Background Effects --- */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, var(--bg-dark) 0%, var(--bg-darker) 100%);
    pointer-events: none;
    z-index: -1;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: -2;
    animation: float-slow 25s ease-in-out infinite alternate;
}

.glow-orb.primary {
    top: -5%;
    right: 5%;
    width: 45vw;
    height: 45vw;
    background: var(--glow-primary);
}

.glow-orb.secondary {
    bottom: -15%;
    left: -5%;
    width: 55vw;
    height: 55vw;
    background: var(--glow-secondary);
    animation-delay: -12s;
}

/* --- Navigation --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.25rem 6%;
    z-index: 10;
    position: relative;
}

.logo-brand {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.15em;
    background: linear-gradient(135deg, #ffffff 0%, var(--gold-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: opacity 0.3s ease;
}

.logo-brand:hover {
    opacity: 0.9;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.25rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--gold-primary);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

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

/* --- Main Content Layout --- */
.hero-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 2rem 3rem 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    z-index: 1;
    min-height: calc(100vh - 180px);
}

.hero-content {
    text-align: center;
    margin-top: auto;
    margin-bottom: auto;
    max-width: 800px;
}

.logo-wrapper {
    display: inline-block;
    margin-bottom: 0.3rem;
    position: relative;
}

.logo-wrapper::after {
    content: '';
    position: absolute;
    inset: -15px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(226, 184, 59, 0.08) 0%, transparent 70%);
    z-index: -1;
}

.hero-logo {
    max-width: 560px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 0 25px rgba(226, 184, 59, 0.15));
}

.hero-content h1 {
    font-family: 'Cinzel', serif;
    font-size: clamp(2.25rem, 5.5vw, 4rem);
    font-weight: 400;
    letter-spacing: 0.18em;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,0.3));
}

.subtitle {
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 0.08em;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Glassmorphic Card --- */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.25rem;
    width: 100%;
    max-width: 360px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    text-align: center;
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1),
                border-color 0.5s ease,
                box-shadow 0.5s ease;
    position: relative;
    overflow: hidden;
    margin-top: 2rem;
}

/* Card hover animation in normal states */
.glass-card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4),
                0 0 30px rgba(226, 184, 59, 0.03);
}

/* Slide animation screen layout */
.card-screen {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.card-screen.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.glass-card h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.glass-card .description {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 1.75rem;
}

/* --- Buttons --- */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: none;
}

.btn-primary {
    background: var(--gold-gradient);
    color: #04050a;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #d4af37 100%);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(212, 175, 55, 0.3);
    color: var(--gold-primary);
    transform: translateY(-1px);
}

/* Back button in login form */
.btn-back {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-back:hover {
    color: var(--gold-primary);
}

.btn-back svg {
    transition: transform 0.3s ease;
}

.btn-back:hover svg {
    transform: translateX(-3px);
}

/* Button ripple effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: ripple-anim 0.6s linear;
    pointer-events: none;
}

.btn-primary .ripple {
    background: rgba(255, 255, 255, 0.5);
}

/* --- Form Controls --- */
.login-form, .modal-form {
    text-align: left;
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.input-group input, 
.input-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input:focus, 
.input-group textarea:focus {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.08);
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Error message styling */
.error-message {
    color: #ef4444;
    font-size: 0.78rem;
    margin-bottom: 1rem;
    text-align: left;
    min-height: 1.2rem;
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-feedback {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    min-height: 1.2rem;
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-feedback.success {
    color: #10b981;
    display: block;
}

.form-feedback.error {
    color: #ef4444;
    display: block;
}

/* Button Spinner */
.btn-submit {
    position: relative;
}

.spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top: 2px solid #000000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
}

.btn-outline .spinner {
    border-top-color: var(--gold-primary);
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 5, 10, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.glass-modal {
    background: rgba(9, 13, 26, 0.8);
    border: 1px solid var(--glass-border-hover);
    border-radius: 28px;
    padding: 3rem;
    width: 100%;
    max-width: 540px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modal-overlay.active .glass-modal {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}

.modal-close:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.glass-modal h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.modal-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.modal-description a {
    color: var(--gold-primary);
    text-decoration: none;
    transition: color 0.3s ease, border-bottom 0.3s ease;
    border-bottom: 1px dashed rgba(226, 184, 59, 0.4);
}

.modal-description a:hover {
    color: var(--gold-hover);
    border-bottom-style: solid;
}

/* --- Footer --- */
.footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2.5rem 6%;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    z-index: 10;
    position: relative;
    margin-top: auto;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

.footer-links {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--gold-primary);
}

.separator {
    color: rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
}

/* --- Animations --- */
@keyframes float-slow {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(3vw, -4vh) scale(1.05);
    }
    100% {
        transform: translate(-2vw, 3vh) scale(0.95);
    }
}

@keyframes ripple-anim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .navbar {
        padding: 1.5rem 5%;
        flex-direction: column;
        gap: 1.25rem;
        text-align: center;
    }
    
    .nav-links {
        gap: 1.5rem;
    }

    .hero-container {
        padding: 2rem 1.25rem;
        min-height: auto;
    }

    .hero-content h1 {
        margin-top: 1.5rem;
    }

    .glass-card {
        margin-top: 3rem;
        padding: 2rem 1.5rem;
    }
    
    .input-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .glass-modal {
        padding: 2rem;
    }

    .footer {
        flex-direction: column;
        gap: 1rem;
        padding: 2rem 5%;
        text-align: center;
    }
}
