/* =====================================================
   VietValuation - Premium Light Theme (Minimalism + Swiss Style)
   Design System: Teal/Turquoise Palette
   ===================================================== */

/* Google Fonts - Be Vietnam Pro (Vietnamese support) */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette */
    --color-primary: #0F766E;
    --color-secondary: #14B8A6;
    --color-cta: #0369A1;
    --color-background: #F0FDFA;
    --color-text: #134E4A;
    --color-text-secondary: #5F7B7A;
    --color-text-muted: #94A3B8;

    /* Semantic Colors */
    --color-success: #059669;
    --color-warning: #D97706;
    --color-error: #DC2626;

    /* Surface Colors */
    --color-surface: #FFFFFF;
    --color-surface-hover: #F0FDFA;
    --color-border: #D1E7E5;
    --color-border-focus: #0F766E;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0F766E 0%, #14B8A6 100%);
    --gradient-cta: linear-gradient(135deg, #0369A1 0%, #0284C7 100%);

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

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(15, 118, 110, 0.05);
    --shadow-md: 0 4px 6px rgba(15, 118, 110, 0.08);
    --shadow-lg: 0 10px 15px rgba(15, 118, 110, 0.1);
    --shadow-xl: 0 20px 25px rgba(15, 118, 110, 0.12);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

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

body {
    font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Subtle Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 10% 20%, rgba(20, 184, 166, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(15, 118, 110, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

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

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

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    color: white;
    box-shadow: var(--shadow-md);
}

.logo-icon svg {
    width: 32px;
    height: 32px;
}

.logo h1 {
    font-family: 'Be Vietnam Pro', -apple-system, sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.02em;
}

.tagline {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

/* Main Content */
.main-content {
    flex: 1;
}

/* Form Sections */
.form-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.form-section:hover {
    border-color: var(--color-secondary);
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--color-background);
    border-radius: var(--radius-sm);
    color: var(--color-primary);
}

.section-icon svg {
    width: 24px;
    height: 24px;
}

.section-header h2 {
    font-family: 'Be Vietnam Pro', -apple-system, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
}

.subsection-title {
    font-family: 'Be Vietnam Pro', -apple-system, sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin: var(--space-lg) 0 var(--space-md);
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.required {
    color: var(--color-error);
}

/* Inputs */
input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

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

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235F7B7A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

select option {
    background: var(--color-surface);
    color: var(--color-text);
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.checkbox-grid.large {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    transition: all var(--transition-normal);
}

.checkbox-item:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-secondary);
    color: var(--color-text);
}

.checkbox-item.warning:hover {
    background: #FEF2F2;
    border-color: var(--color-error);
}

.checkbox-item input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    flex-shrink: 0;
    background: var(--color-surface);
}

.checkbox-item input:checked+.checkmark {
    background: var(--gradient-primary);
    border-color: transparent;
}

.checkbox-item input:checked+.checkmark::after {
    content: '';
    display: block;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.checkbox-item:has(input:checked) {
    background: rgba(20, 184, 166, 0.08);
    border-color: var(--color-secondary);
    color: var(--color-text);
}

/* Checkbox Icons */
.checkbox-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.checkbox-icon svg {
    width: 16px;
    height: 16px;
}

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

.btn-submit {
    padding: var(--space-md) var(--space-2xl);
    background: var(--gradient-cta);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-submit:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.3);
}

.btn-submit.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-submit .btn-loading {
    display: none;
}

.btn-submit.loading .btn-text {
    display: none;
}

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

.btn-submit svg {
    width: 20px;
    height: 20px;
}

/* Spinner Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

/* Result Section */
.result-section {
    margin-top: var(--space-xl);
}

.result-section.hidden {
    display: none;
}

.result-card {
    background: var(--color-surface);
    border: 2px solid var(--color-success);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    box-shadow: var(--shadow-md);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.result-header {
    margin-bottom: var(--space-lg);
}

.result-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: rgba(5, 150, 105, 0.1);
    border-radius: 50%;
    margin: 0 auto var(--space-md);
    color: var(--color-success);
}

.result-icon svg {
    width: 32px;
    height: 32px;
}

.result-header h2 {
    font-family: 'Be Vietnam Pro', -apple-system, sans-serif;
    font-size: 1.5rem;
    color: var(--color-success);
}

.result-content {
    margin-bottom: var(--space-lg);
}

.result-content p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.result-content strong {
    color: var(--color-text);
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: var(--color-background);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

.result-note {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.btn-new {
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

.btn-new:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-secondary);
    color: var(--color-text);
}

.btn-new:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.btn-new svg {
    width: 18px;
    height: 18px;
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--space-xl) 0;
    margin-top: auto;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

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

    .logo h1 {
        font-size: 1.75rem;
    }

    .logo-icon {
        width: 48px;
        height: 48px;
    }

    .logo-icon svg {
        width: 28px;
        height: 28px;
    }

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

    .form-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-grid,
    .checkbox-grid.large {
        grid-template-columns: 1fr;
    }

    .btn-submit {
        width: 100%;
        justify-content: center;
    }
}