/**
 * Granata Landing Page Styles
 * Design tokens based on src/theme/design-tokens.scss
 */

:root {
    /* Backgrounds */
    --bg-primary: #0f0f0f;
    --bg-elevated: #1a1a1a;
    --bg-card: #242424;
    --bg-surface: #2d2d2d;

    /* Text */
    --text-primary: #f5f5f0;
    --text-secondary: #a8a8a0;
    --text-muted: #6b6b65;

    /* Accent */
    --accent-primary: #e8685a;
    --accent-primary-hover: #ed7d70;

    /* Status */
    --color-success: #5a8a5a;
    --color-error: #b33a3a;

    /* Borders */
    --border-default: #3d3d3d;
    --border-focus: var(--accent-primary);

    /* Typography */
    --font-display: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-primary: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Shadows */
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 4px 16px rgba(232, 104, 90, 0.25);

    /* Transitions */
    --transition-fast: 100ms;
    --transition-normal: 200ms;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

/* Container */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: var(--space-6);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    padding: var(--space-12) 0 var(--space-8);
}

.logo {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 100;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.tagline {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 300;
}

/* Content */
.content {
    flex: 1;
}

.title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--text-primary);
}

.description {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
    line-height: 1.6;
}

/* Form */
.form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

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

.label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.optional {
    font-weight: 400;
    color: var(--text-muted);
}

.input,
.textarea {
    font-family: var(--font-primary);
    font-size: 15px;
    color: var(--text-primary);
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    transition: border-color var(--transition-normal) var(--ease-out-expo),
                box-shadow var(--transition-normal) var(--ease-out-expo);
    outline: none;
}

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

.input:focus,
.textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(232, 104, 90, 0.15);
}

.input:disabled,
.textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.textarea {
    resize: vertical;
    min-height: 100px;
}

/* Submit Button */
.submit-btn {
    font-family: var(--font-primary);
    font-size: 15px;
    font-weight: 600;
    color: var(--bg-primary);
    background-color: var(--accent-primary);
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-6);
    cursor: pointer;
    transition: background-color var(--transition-normal) var(--ease-out-expo),
                transform var(--transition-fast) var(--ease-out-expo),
                box-shadow var(--transition-normal) var(--ease-out-expo);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.submit-btn:hover:not(:disabled) {
    background-color: var(--accent-primary-hover);
    box-shadow: var(--shadow-glow);
}

.submit-btn:active:not(:disabled) {
    transform: scale(0.98);
}

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

.btn-loading {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    animation: spin 1s linear infinite;
}

.spinner-circle {
    stroke: currentColor;
    stroke-dasharray: 45;
    stroke-dashoffset: 30;
}

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

/* Messages */
.message {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    border-radius: var(--radius-lg);
    background-color: var(--bg-elevated);
}

.message-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-4);
}

.success-message .message-icon {
    color: var(--color-success);
}

.error-message .message-icon {
    color: var(--color-error);
}

.message-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.message-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Retry Button */
.retry-btn {
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 500;
    color: var(--accent-primary);
    background: none;
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-4);
    cursor: pointer;
    margin-top: var(--space-4);
    transition: background-color var(--transition-normal) var(--ease-out-expo),
                color var(--transition-normal) var(--ease-out-expo);
}

.retry-btn:hover {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--space-8) 0 var(--space-4);
    font-size: 12px;
    color: var(--text-muted);
}

/* Hidden utility */
[hidden] {
    display: none !important;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: var(--space-4);
    }

    .header {
        padding: var(--space-8) 0 var(--space-6);
    }

    .logo {
        font-size: 40px;
    }

    .title {
        font-size: 22px;
    }
}

@media (min-width: 768px) {
    .container {
        padding: var(--space-8);
        justify-content: center;
    }

    .header {
        padding: var(--space-6) 0 var(--space-8);
    }
}

/* Focus visible for keyboard navigation */
.submit-btn:focus-visible,
.retry-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}
