/* =========================================
   RESET & BASE STYLES
   Khachaak Theme Palette:
   - Background: #050505
   - Card Background: #0d0d0d / #111111
   - Primary Accent (Bronze): #c79a76
   - Light Accent: #e0b394
   - Text White: #f5f5f5
   - Text Grey: #a8a8a8
========================================= */

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

html {
    scroll-behavior: smooth;
    background-color: #050505;
    color: #f5f5f5;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: #050505;
    color: #f5f5f5;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* =========================================
   VARIABLES & SCROLLBAR
========================================= */

:root {
    --bg: #050505;
    --card-bg: rgba(15, 15, 15, 0.85);
    --card-border: rgba(199, 154, 118, 0.25);
    --bronze: #c79a76;
    --bronze-light: #e0b394;
    --bronze-glow: rgba(199, 154, 118, 0.15);
    --white: #f5f5f5;
    --grey: #a8a8a8;
    --transition: 0.35s ease;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #050505;
}

::-webkit-scrollbar-thumb {
    background: var(--bronze);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bronze-light);
}

::selection {
    background: var(--bronze);
    color: #050505;
}

/* =========================================
   BACKGROUND GRAPHICS & LIGHT LEAK
========================================= */

.hero-overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 50% 20%, rgba(199, 154, 118, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(199, 154, 118, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 20% 70%, rgba(20, 20, 20, 0.8) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.hero-noise {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 4px 4px;
    opacity: 0.12;
    mix-blend-mode: soft-light;
    pointer-events: none;
    z-index: 1;
}

.cursor-glow {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(199, 154, 118, 0.12) 0%, transparent 70%);
    position: fixed;
    pointer-events: none;
    z-index: 2;
    transform: translate(-50%, -50%);
    transition: opacity 0.5s ease;
}

/* =========================================
   CAMERA VIEWFINDER CORNERS
========================================= */

.viewfinder {
    position: fixed;
    width: 45px;
    height: 45px;
    z-index: 100;
    pointer-events: none;
    transition: var(--transition);
}

.top-left {
    top: 20px;
    left: 20px;
    border-top: 2px solid var(--bronze);
    border-left: 2px solid var(--bronze);
}

.top-right {
    top: 20px;
    right: 20px;
    border-top: 2px solid var(--bronze);
    border-right: 2px solid var(--bronze);
}

.bottom-left {
    bottom: 20px;
    left: 20px;
    border-bottom: 2px solid var(--bronze);
    border-left: 2px solid var(--bronze);
}

.bottom-right {
    bottom: 20px;
    right: 20px;
    border-bottom: 2px solid var(--bronze);
    border-right: 2px solid var(--bronze);
}

/* =========================================
   CAMERA HUD METADATA OVERLAYS
========================================= */

.hud-top-left {
    position: fixed;
    top: 28px;
    left: 75px;
    z-index: 90;
    font-size: 0.72rem;
    letter-spacing: 2px;
    font-weight: 600;
    color: var(--bronze);
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    font-family: 'Inter', monospace;
}

.rec-dot {
    width: 8px;
    height: 8px;
    background-color: #ff3b30;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.8);
    animation: recPulse 1.8s infinite;
}

@keyframes recPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.85); }
}

.hud-top-right {
    position: fixed;
    top: 28px;
    right: 75px;
    z-index: 90;
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    font-weight: 500;
    color: var(--grey);
    display: flex;
    gap: 14px;
    pointer-events: none;
    font-family: 'Inter', monospace;
}

.hud-bottom-left {
    position: fixed;
    bottom: 28px;
    left: 75px;
    z-index: 90;
    font-size: 0.72rem;
    letter-spacing: 2px;
    color: var(--grey);
    pointer-events: none;
    font-family: 'Inter', monospace;
}

.hud-bottom-right {
    position: fixed;
    bottom: 28px;
    right: 75px;
    z-index: 90;
    font-size: 0.72rem;
    letter-spacing: 2px;
    color: var(--grey);
    pointer-events: none;
    font-family: 'Inter', monospace;
}

/* =========================================
   HEADER / NAVBAR
========================================= */

header.navbar {
    position: sticky;
    top: 0;
    z-index: 80;
    width: 100%;
    padding: 24px 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(5, 5, 5, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(199, 154, 118, 0.15);
    margin-bottom: 30px;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
}

.brand-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(199, 154, 118, 0.2));
    transition: transform 0.3s ease;
}

.brand-wrapper:hover .brand-logo {
    transform: scale(1.05) rotate(5deg);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.9rem;
    font-weight: 600;
    color: var(--white);
    line-height: 1.1;
    letter-spacing: 1px;
}

.brand-sub {
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--bronze);
    font-weight: 500;
}

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

.btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--bronze);
    border: 1px solid var(--bronze);
    background: transparent;
    border-radius: 4px;
    text-decoration: none;
    transition: var(--transition);
}

.btn-nav:hover {
    background: var(--bronze);
    color: #050505;
    box-shadow: 0 4px 20px rgba(199, 154, 118, 0.25);
    transform: translateY(-2px);
}

/* =========================================
   MAIN WRAPPER & FORM CONTAINER
========================================= */

main.main-content {
    position: relative;
    z-index: 10;
    flex: 1;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Form Banner Header */
.form-header-badge {
    text-align: center;
    margin-bottom: 28px;
    animation: fadeInDown 0.8s ease forwards;
}

.aperture-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(199, 154, 118, 0.1);
    border: 1px solid rgba(199, 154, 118, 0.3);
    border-radius: 20px;
    color: var(--bronze-light);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.form-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    color: var(--white);
    letter-spacing: 3px;
    line-height: 1.1;
    margin-bottom: 8px;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.8);
}

.form-subtitle {
    font-size: 0.95rem;
    color: var(--grey);
    max-width: 550px;
    margin: 0 auto;
    font-weight: 400;
}

/* Card Container for Tally Embed */
.tally-card {
    position: relative;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 
        0 24px 60px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(199, 154, 118, 0.05);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 10px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.tally-card:hover {
    border-color: rgba(199, 154, 118, 0.45);
    box-shadow: 
        0 30px 70px rgba(0, 0, 0, 0.8),
        0 0 50px rgba(199, 154, 118, 0.1);
}

/* Card Camera Accents */
.card-focus-corners {
    position: absolute;
    inset: 12px;
    pointer-events: none;
    z-index: 5;
}

.card-focus-corners::before,
.card-focus-corners::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: rgba(199, 154, 118, 0.3);
    border-style: solid;
}

.card-focus-corners::before {
    top: 0;
    left: 0;
    border-width: 1px 0 0 1px;
}

.card-focus-corners::after {
    bottom: 0;
    right: 0;
    border-width: 0 1px 1px 0;
}

/* Loader animation inside iframe wrapper */
.form-loader-wrapper {
    position: absolute;
    inset: 0;
    background: #0d0d0d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 4;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.shutter-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(199, 154, 118, 0.15);
    border-top: 3px solid var(--bronze);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.form-loader-wrapper p {
    font-size: 0.82rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--bronze);
    font-family: 'Inter', monospace;
}

/* Tally Iframe container styling */
.tally-iframe-container {
    width: 100%;
    min-height: 550px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: transparent;
}

.tally-iframe-container iframe {
    width: 100%;
    min-height: 550px;
    border: none;
    display: block;
    background: transparent !important;
}

/* External Link Fallback Bar */
.fallback-footer-bar {
    margin-top: 24px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--grey);
}

.fallback-footer-bar a {
    color: var(--bronze-light);
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
}

.fallback-footer-bar a:hover {
    color: var(--white);
}

/* =========================================
   FOOTER
========================================= */

footer.wrapper-footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(5, 5, 5, 0.9);
    font-size: 0.8rem;
    color: var(--grey);
}

footer.wrapper-footer p {
    margin-bottom: 6px;
}

footer.wrapper-footer .footer-social {
    color: var(--bronze);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 1px;
    transition: color 0.2s ease;
}

footer.wrapper-footer .footer-social:hover {
    color: var(--bronze-light);
    text-shadow: 0 0 10px rgba(199, 154, 118, 0.4);
}

/* =========================================
   KEYFRAMES
========================================= */

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

/* =========================================
   RESPONSIVE LAYOUT (MOBILE & TABLET)
========================================= */

@media (max-width: 768px) {
    .viewfinder {
        width: 30px;
        height: 30px;
    }

    .top-left { top: 12px; left: 12px; }
    .top-right { top: 12px; right: 12px; }
    .bottom-left { bottom: 12px; left: 12px; }
    .bottom-right { bottom: 12px; right: 12px; }

    .hud-top-left { top: 16px; left: 50px; font-size: 0.65rem; }
    .hud-top-right { display: none; }
    .hud-bottom-left { bottom: 16px; left: 50px; font-size: 0.65rem; }
    .hud-bottom-right { bottom: 16px; right: 50px; font-size: 0.65rem; }

    main.main-content {
        padding: 45px 12px 40px 12px;
    }

    .tally-card {
        padding: 4px;
        border-radius: 12px;
    }

    .tally-iframe-container {
        min-height: 600px;
    }
}
