/* ================
   Taconic Trading
   ================ */

:root {
    /* Primary Palette - Refined Navy & Off-White */
    --color-navy: #1a2a3a;
    --color-navy-light: #2d4156;
    --color-slate: #4a5d6f;
    --color-steel: #7a8fa0;
    
    /* Light Tones */
    --color-cream: #f8f9fa;
    --color-off-white: #fafbfc;
    --color-white: #ffffff;
    --color-ice: #e8eef3;
    --color-mist: #dce4eb;
    
    /* Accent */
    --color-accent: #3d5a80;
    --color-accent-hover: #2c4a6e;
    
    /* Typography */
    --font-display: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    --font-body: 'Libre Franklin', 'Helvetica Neue', Arial, sans-serif;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;
}

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=Libre+Franklin:wght@300;400;500&display=swap');

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.7;
    color: var(--color-navy);
    background: var(--color-off-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Header
   ============================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(250, 251, 252, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-ice);
    transition: all 0.3s ease;
}

.header-inner {
    width: min(1200px, 90vw);
    margin: 0 auto;
    padding: 0.75rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.header-brand {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--color-navy);
    white-space: nowrap;
}

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

.header-nav a {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-slate);
    text-decoration: none;
    position: relative;
    padding: 0.2rem 0;
    transition: color 0.25s ease;
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-accent);
    transition: width 0.25s ease;
}

.header-nav a:hover,
.header-nav a:focus-visible {
    color: var(--color-navy);
}

.header-nav a:hover::after,
.header-nav a:focus-visible::after {
    width: 100%;
}

.header-nav a[aria-current="page"] {
    color: var(--color-navy);
}

.header-nav a[aria-current="page"]::after {
    width: 100%;
}

/* ============================================
   Landing / Hero
   ============================================ */
.landing {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: calc(var(--space-2xl) + 60px) var(--space-lg) var(--space-2xl);
    background: 
        linear-gradient(180deg, var(--color-off-white) 0%, var(--color-cream) 50%, var(--color-ice) 100%);
    position: relative;
}

.landing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% 20%, rgba(61, 90, 128, 0.03) 0%, transparent 60%);
    pointer-events: none;
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    width: min(800px, 100%);
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-logo {
    width: min(420px, 65vw);
    height: auto;
    filter: drop-shadow(0 8px 32px rgba(26, 42, 58, 0.08));
    margin-bottom: var(--space-sm);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 500;
    letter-spacing: 0.12em;
    color: var(--color-navy);
    margin-bottom: var(--space-xs);
}

.hero-divider {
    width: 60px;
    height: 1px;
    background: var(--color-steel);
    margin: var(--space-sm) 0;
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    color: var(--color-slate);
    max-width: 480px;
    line-height: 1.8;
}

/* ============================================
   Contact Page
   ============================================ */
.contact-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(var(--space-2xl) + 60px) var(--space-md) var(--space-2xl);
    background: 
        linear-gradient(180deg, var(--color-off-white) 0%, var(--color-cream) 100%);
    min-height: 100vh;
}

.contact-container {
    width: 100%;
    max-width: 580px;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.contact-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.contact-intro h1 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--color-navy);
    line-height: 1.3;
    text-align: center;
}

.contact-divider {
    width: 50px;
    height: 2px;
    background: var(--color-accent);
}

.contact-intro p {
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--color-slate);
    line-height: 1.85;
    width: 100%;
    text-align: left;
}

.contact-form-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    background: var(--color-white);
    padding: 2.5rem 3rem;
    border-radius: 16px;
    box-shadow: 
        0 4px 6px rgba(10, 22, 40, 0.04),
        0 10px 40px rgba(10, 22, 40, 0.08);
    border: none;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-steel);
}

.form-row input,
.form-row select {
    border: 1px solid var(--color-ice);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--color-navy);
    background: var(--color-cream);
    transition: all 0.2s ease;
}

.form-row input::placeholder {
    color: var(--color-steel);
}

.form-row input:hover,
.form-row select:hover {
    border-color: var(--color-mist);
    background: var(--color-off-white);
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: #0a1628;
    background: var(--color-white);
    box-shadow: 0 0 0 3px rgba(10, 22, 40, 0.08);
}

.form-row select {
    appearance: none;
    cursor: pointer;
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="%234a5d6f"%3E%3Cpath fill-rule="evenodd" d="M5.23 7.21a.75.75 0 011.06.02L10 10.584l3.71-3.353a.75.75 0 111.02 1.096l-4.22 3.818a.75.75 0 01-1.02 0L5.21 8.326a.75.75 0 01.02-1.116z" clip-rule="evenodd"/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.form-row select option {
    color: var(--color-navy);
}

.form-privacy {
    font-size: 0.7rem;
    font-weight: 300;
    color: var(--color-steel);
    line-height: 1.7;
    margin-top: var(--space-xs);
    text-align: center;
}

.form-privacy a {
    color: var(--color-slate);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.form-privacy a:hover {
    color: var(--color-navy);
}

.form-submit {
    width: 100%;
    padding: 1rem 2.5rem;
    background: #0a1628;
    color: var(--color-white);
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: var(--space-sm);
}

.form-submit:hover,
.form-submit:focus-visible {
    background: #142d4c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 22, 40, 0.2);
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    padding: var(--space-md) var(--space-md);
    background: rgba(250, 251, 252, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--color-ice);
}

.footer-divider-line {
    display: none;
}

.footer-inner {
    width: min(1000px, 90vw);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.footer-locations {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.footer-location {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.footer-location-label {
    font-style: normal;
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--color-slate);
    line-height: 1.6;
}

.footer-primary {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.footer-company {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--color-navy);
    margin-bottom: 0.25rem;
}

.footer-address {
    font-style: normal;
    font-size: 0.6rem;
    font-weight: 300;
    color: var(--color-steel);
    line-height: 1.5;
}

.footer-email {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--color-accent);
    text-decoration: none;
}

.footer-email:hover {
    color: var(--color-navy);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-copy {
    font-size: 0.6rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    color: var(--color-steel);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-xs);
    gap: var(--space-sm);
}

.footer-legal {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-legal a {
    font-size: 0.55rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    color: var(--color-steel);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-legal a:hover {
    color: var(--color-navy);
}

.footer-legal-divider {
    font-size: 0.5rem;
    color: var(--color-mist);
}

/* ============================================
   Legal Pages (Privacy, Terms)
   ============================================ */
.legal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: calc(var(--space-2xl) + 60px) var(--space-md) var(--space-2xl);
    background: linear-gradient(180deg, var(--color-off-white) 0%, var(--color-cream) 100%);
    min-height: 100vh;
}

.legal-container {
    width: 100%;
    max-width: 680px;
}

.legal-container h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--color-navy);
    text-align: center;
}

.legal-divider {
    width: 50px;
    height: 1px;
    background: var(--color-accent);
    margin: var(--space-md) auto var(--space-lg);
}

.legal-updated {
    font-size: 0.75rem;
    color: var(--color-steel);
    text-align: center;
    margin-bottom: var(--space-xl);
}

.legal-section {
    margin-bottom: var(--space-lg);
}

.legal-section h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-navy);
    margin-bottom: var(--space-sm);
}

.legal-section p {
    font-size: 0.9rem;
    color: var(--color-slate);
    margin-bottom: var(--space-sm);
}

.legal-section ul {
    margin-left: var(--space-md);
    margin-bottom: var(--space-sm);
}

.legal-section li {
    font-size: 0.9rem;
    color: var(--color-slate);
    margin-bottom: 0.25rem;
}

.legal-section a {
    color: var(--color-accent);
    text-decoration: none;
}

.legal-section a:hover {
    text-decoration: underline;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 900px) {
    .contact-main {
        padding: calc(var(--space-xl) + 60px) var(--space-md) var(--space-xl);
    }
}

@media (max-width: 600px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem 0;
    }

    .header-nav {
        gap: 1.5rem;
    }

    .header-nav a {
        font-size: 0.75rem;
    }

    .landing {
        padding: var(--space-xl) var(--space-md);
    }

    .hero {
        gap: var(--space-md);
    }

    .hero-logo {
        width: min(280px, 70vw);
    }

    .hero-title {
        letter-spacing: 0.08em;
    }

    .contact-form-section {
        padding: var(--space-lg);
    }

    .form-submit {
        width: 100%;
        text-align: center;
    }

    .site-footer {
        padding: var(--space-md);
    }

    .footer-copy {
        font-size: 0.55rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .footer-legal a {
        font-size: 0.5rem;
    }

    .legal-main {
        padding: calc(var(--space-xl) + 60px) var(--space-md) var(--space-xl);
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Smooth fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero {
    animation: fadeIn 0.8s ease-out;
}

.contact-intro,
.contact-form-section {
    animation: fadeIn 0.6s ease-out;
}

.contact-form-section {
    animation-delay: 0.1s;
    animation-fill-mode: both;
}

/* ============================================
   Auth / Login Page
   ============================================ */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: calc(var(--space-2xl) + 2rem) var(--space-md);
    background: 
        linear-gradient(180deg, var(--color-off-white) 0%, var(--color-cream) 50%, var(--color-ice) 100%);
}

.auth-container {
    width: 100%;
    max-width: 400px;
    background: var(--color-white);
    padding: var(--space-xl);
    border-radius: 2px;
    box-shadow: 
        0 1px 3px rgba(26, 42, 58, 0.04),
        0 8px 40px rgba(26, 42, 58, 0.06);
    border: 1px solid var(--color-ice);
    animation: fadeIn 0.6s ease-out;
}

.auth-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--color-navy);
    text-align: center;
    margin-bottom: var(--space-xs);
}

.auth-divider {
    width: 40px;
    height: 2px;
    background: var(--color-accent);
    margin: var(--space-md) auto var(--space-lg);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.auth-form .form-row {
    width: 100%;
}

.auth-form .form-row input {
    width: 100%;
}

.auth-form .form-submit {
    width: 100%;
    text-align: center;
    margin-top: var(--space-sm);
}

.auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    border-radius: 2px;
}

/* ============================================
   Admin Dashboard
   ============================================ */
.admin-main {
    flex: 1;
    padding: calc(var(--space-2xl) + 2rem) var(--space-md) var(--space-xl);
    background: 
        linear-gradient(180deg, var(--color-off-white) 0%, var(--color-cream) 100%);
    min-height: 100vh;
}

.admin-container {
    width: min(1100px, 100%);
    margin: 0 auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-xl);
    gap: var(--space-md);
    flex-wrap: wrap;
}

.admin-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--color-navy);
}

.admin-welcome {
    font-size: 0.9rem;
    color: var(--color-slate);
    margin-top: 0.25rem;
}

.btn-logout {
    padding: 0.6rem 1.5rem;
    background: transparent;
    color: var(--color-slate);
    border: 1px solid var(--color-mist);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-logout:hover {
    border-color: var(--color-slate);
    color: var(--color-navy);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-md);
}

.admin-card {
    background: var(--color-white);
    padding: var(--space-lg);
    border-radius: 2px;
    box-shadow: 
        0 1px 3px rgba(26, 42, 58, 0.04),
        0 4px 20px rgba(26, 42, 58, 0.04);
    border: 1px solid var(--color-ice);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.card-header h2 {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-navy);
}

.card-badge {
    background: var(--color-accent);
    color: var(--color-white);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
}

.card-description {
    font-size: 0.85rem;
    color: var(--color-slate);
    margin-bottom: var(--space-md);
}

.card-placeholder {
    background: var(--color-cream);
    padding: var(--space-md);
    border-radius: 2px;
    text-align: center;
}

.card-placeholder p {
    font-size: 0.85rem;
    color: var(--color-slate);
}

.card-hint {
    font-size: 0.75rem;
    color: var(--color-steel);
    margin-top: 0.5rem;
}

.card-stats {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--color-navy);
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-steel);
}

.card-link {
    font-size: 0.8rem;
    color: var(--color-accent);
    text-decoration: none;
}

.card-link:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-btn {
    display: block;
    padding: 0.75rem 1rem;
    background: var(--color-cream);
    color: var(--color-navy);
    text-decoration: none;
    font-size: 0.85rem;
    text-align: center;
    border-radius: 2px;
    transition: background 0.2s ease;
}

.action-btn:hover {
    background: var(--color-ice);
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-ice);
}

.account-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.account-label {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-steel);
}

.account-row span:last-child {
    font-size: 0.85rem;
    color: var(--color-navy);
}

.status-badge {
    background: #dcfce7;
    color: #166534;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
}

@media (max-width: 600px) {
    .admin-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-logout {
        align-self: flex-start;
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .card-stats {
        flex-direction: column;
        gap: var(--space-sm);
    }
}

/* ───────────────────────────────────────
   Form Loading & Messages
─────────────────────────────────────── */

.form-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

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

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

.form-message {
    display: none;
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.form-message.success {
    background: rgba(10, 22, 40, 0.05);
    color: #0a1628;
    border: 1px solid rgba(10, 22, 40, 0.15);
}

.form-message.error {
    background: rgba(185, 28, 28, 0.05);
    color: #991b1b;
    border: 1px solid rgba(185, 28, 28, 0.15);
}
