/* ========================================
   DUA Karahi & Grill - Intake Form Styles
   Brand Colors:
   - Brushed Copper: #B87333
   - Deep Indigo: #1a2744
   - Emerald Green: #0d6b58
   - Cream: #f5f0e8
   - Charcoal: #3d3d3d
======================================== */

/* CSS Custom Properties */
:root {
    /* Brand Colors */
    --copper: #B87333;
    --copper-light: #d4956b;
    --copper-dark: #915a28;
    --indigo: #1a2744;
    --indigo-light: #2a3d5c;
    --emerald: #0d6b58;
    --emerald-light: #14917a;
    --cream: #f5f0e8;
    --cream-dark: #e8e0d4;
    --charcoal: #3d3d3d;
    --charcoal-light: #5a5a5a;

    /* Status Colors */
    --error: #c53030;
    --error-light: #feb2b2;
    --success: #0d6b58;
    --success-light: #c6f6d5;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--indigo) 0%, #0f1829 100%);
    --gradient-copper: linear-gradient(135deg, var(--copper) 0%, var(--copper-dark) 100%);
    --gradient-glow: radial-gradient(ellipse at center, rgba(184, 115, 51, 0.15) 0%, transparent 70%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(26, 39, 68, 0.08);
    --shadow-md: 0 8px 24px rgba(26, 39, 68, 0.12);
    --shadow-lg: 0 16px 48px rgba(26, 39, 68, 0.16);
    --shadow-glow: 0 0 40px rgba(184, 115, 51, 0.2);

    /* Typography */
    --font-primary: 'Optima', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 50%;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background: var(--gradient-primary);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    position: relative;
    overflow-x: hidden;
    color: var(--charcoal);
    line-height: 1.5;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(184, 115, 51, 0.2);
    border-top-color: var(--copper);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Background Effects */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-glow);
    pointer-events: none;
    z-index: 0;
}

.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23B87333' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* Main Container */
.container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

/* Form Card */
.form-card {
    background: var(--cream);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.form-card.hidden {
    display: none;
}

.form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-copper);
}

/* Success Card */
.success-card {
    background: var(--cream);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    position: relative;
    overflow: hidden;
    display: none;
    text-align: center;
}

.success-card.visible {
    display: block;
}

.success-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--emerald) 0%, var(--emerald-light) 100%);
}

.success-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    background: linear-gradient(135deg, var(--emerald) 0%, var(--emerald-light) 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.success-icon {
    width: 40px;
    height: 40px;
    color: white;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

.success-content {
    opacity: 0;
}

.success-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--indigo);
    margin-bottom: var(--space-sm);
}

.success-message {
    color: var(--charcoal-light);
    font-size: 0.9375rem;
    margin-bottom: var(--space-md);
    line-height: 1.6;
}

.success-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--copper);
    font-style: italic;
}

.success-divider {
    margin: var(--space-xl) 0;
    opacity: 0;
}

.success-footer {
    opacity: 0;
}

.success-footer p {
    font-size: 0.875rem;
    color: var(--charcoal-light);
    margin-bottom: var(--space-md);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
}

.social-link {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 39, 68, 0.05);
    border-radius: var(--radius-sm);
    color: var(--indigo);
    transition: all var(--transition-base);
}

.social-link:hover {
    background: var(--indigo);
    color: var(--cream);
    transform: translateY(-2px);
}

.social-link svg {
    width: 22px;
    height: 22px;
}

/* Logo Section */
.logo-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-lg);
}

.logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(184, 115, 51, 0.2));
    will-change: transform;
}

/* Branding */
.branding {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.brand-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--indigo);
    letter-spacing: 0.3em;
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
}

.brand-tagline {
    font-size: 0.875rem;
    color: var(--charcoal-light);
    letter-spacing: 0.15em;
    font-weight: 400;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--copper-light), transparent);
    max-width: 80px;
}

.divider-ornament {
    color: var(--copper);
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Form Intro */
.form-intro {
    text-align: center;
    color: var(--charcoal-light);
    font-size: 0.9375rem;
    margin-bottom: var(--space-xl);
    font-style: italic;
    line-height: 1.6;
}

/* Input Groups */
.input-group {
    margin-bottom: var(--space-lg);
}

.input-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--indigo);
    margin-bottom: var(--space-sm);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.input-label .required {
    color: var(--copper);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--space-md);
    width: 20px;
    height: 20px;
    color: var(--charcoal-light);
    pointer-events: none;
    transition: color var(--transition-base);
    z-index: 2;
}

.input-wrapper input {
    width: 100%;
    padding: var(--space-md) var(--space-md) var(--space-md) calc(var(--space-md) + 28px);
    font-family: var(--font-primary);
    font-size: 1rem;
    color: var(--charcoal);
    background: rgba(255, 255, 255, 0.8);
    border: 1.5px solid var(--cream-dark);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--transition-base);
    -webkit-appearance: none;
    appearance: none;
}

.input-wrapper input::placeholder {
    color: var(--charcoal-light);
    opacity: 0.6;
}

.input-wrapper input:hover {
    border-color: var(--copper-light);
    background: rgba(255, 255, 255, 0.95);
}

.input-wrapper input:focus {
    border-color: var(--copper);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.1);
}

.input-wrapper input:focus+.input-focus-ring {
    opacity: 1;
}

.input-wrapper:has(input:focus) .input-icon {
    color: var(--copper);
}

/* Input Error States */
.input-wrapper input.error {
    border-color: var(--error);
    background: rgba(254, 178, 178, 0.1);
}

.input-wrapper input.error:focus {
    box-shadow: 0 0 0 3px rgba(197, 48, 48, 0.1);
}

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

.input-error {
    display: block;
    font-size: 0.75rem;
    color: var(--error);
    margin-top: var(--space-xs);
    min-height: 1rem;
    opacity: 0;
    transform: translateY(-5px);
    transition: all var(--transition-fast);
}

.input-error.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Input Valid States */
.input-wrapper input.valid {
    border-color: var(--emerald);
}

.input-wrapper:has(input.valid) .input-icon {
    color: var(--emerald);
}

.input-focus-ring {
    position: absolute;
    inset: -3px;
    border-radius: calc(var(--radius-sm) + 3px);
    border: 2px solid var(--copper);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

/* Contact Notice */
.contact-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-size: 0.8125rem;
    color: var(--charcoal-light);
    margin-bottom: var(--space-lg);
    padding: var(--space-sm) var(--space-md);
    background: rgba(26, 39, 68, 0.03);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.contact-notice.satisfied {
    background: rgba(13, 107, 88, 0.08);
    color: var(--emerald);
}

.notice-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Autofill Styling */
.input-wrapper input:-webkit-autofill,
.input-wrapper input:-webkit-autofill:hover,
.input-wrapper input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.95) inset;
    -webkit-text-fill-color: var(--charcoal);
    border-color: var(--copper-light);
    transition: background-color 5000s ease-in-out 0s;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cream);
    background: var(--gradient-copper);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
    margin-top: var(--space-md);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.submit-btn:not(:disabled)::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.submit-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 8px 24px rgba(184, 115, 51, 0.3);
}

.submit-btn:not(:disabled):hover::before {
    opacity: 1;
}

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

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-arrow {
    width: 18px;
    height: 18px;
    position: relative;
    z-index: 1;
    transition: transform var(--transition-base);
}

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

/* Button Loading State */
.submit-btn.loading .btn-text,
.submit-btn.loading .btn-arrow {
    opacity: 0;
}

.btn-spinner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    opacity: 0;
    animation: spin 0.8s linear infinite;
}

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

/* Form Footer */
.form-footer {
    margin-top: var(--space-xl);
    text-align: center;
}

.form-footer p {
    font-size: 0.75rem;
    color: var(--charcoal-light);
    opacity: 0.7;
    line-height: 1.6;
}

/* Animations - Initial States (GSAP will animate these) */
.form-card .logo-wrapper,
.form-card .branding,
.form-card .divider,
.form-card .form-intro,
.form-card .input-group,
.form-card .contact-notice,
.form-card .submit-btn,
.form-card .form-footer {
    opacity: 0;
}

/* Focus States for Accessibility */
.submit-btn:focus-visible {
    outline: 2px solid var(--copper);
    outline-offset: 2px;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    body {
        padding: var(--space-md);
        align-items: flex-start;
        padding-top: var(--space-xl);
    }

    .form-card,
    .success-card {
        padding: var(--space-lg);
        border-radius: var(--radius-md);
    }

    .logo {
        width: 100px;
        height: 100px;
    }

    .brand-name {
        font-size: 2rem;
        letter-spacing: 0.25em;
    }

    .brand-tagline {
        font-size: 0.8125rem;
    }

    .success-icon-wrapper {
        width: 70px;
        height: 70px;
    }

    .success-icon {
        width: 35px;
        height: 35px;
    }

    .success-title {
        font-size: 1.5rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .form-card .logo-wrapper,
    .form-card .branding,
    .form-card .divider,
    .form-card .form-intro,
    .form-card .input-group,
    .form-card .contact-notice,
    .form-card .submit-btn,
    .form-card .form-footer {
        opacity: 1;
    }

    .loading-screen {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .input-wrapper input {
        border-width: 2px;
    }

    .submit-btn {
        border: 2px solid var(--cream);
    }
}