/* wwwroot/css/site.css */
:root {
    --primary-color: #7c5dfa;
    --primary-dark: #6345ed;
    --text-primary: #2d2d2d;
    --text-secondary: #6b7280;
    --boQrder-color: #e5e7eb;
    --background-cream: #faf9f6;
    --success-color: #10b981;
    --error-color: #ef4444;
    --border-radius: 8px;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-cream);
    margin: 0;
    padding: 0;
}

/* Welcome Page Styles */
.welcome-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.welcome-content {
    max-width: 500px;
    text-align: center;
    width: 100%;
}

.logo-container {
    margin-bottom: 3rem;
}

.logo {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.3em;
    color: var(--text-primary);
    margin: 0;
}

.welcome-text h2 {
    font-size: 1.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.welcome-text p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-align: left;
}

.btn-start {
    background-color: var(--primary-color);
    border: none;
    color: white;
    font-weight: 500;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
    transition: background-color 0.2s ease;
    font-size: 1rem;
    text-decoration: none;
}

.btn-start:hover {
    background-color: var(--primary-dark);
    color: white;
}

.version-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 3rem;
}

/* Form Layout Styles */
.form-body {
    background-color: var(--background-cream);
    min-height: 100vh;
}

.progress-container {
    padding: 0;
}

.progress-bar-custom {
    width: 100%;
    height: 4px;
    background-color: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.form-container {
    flex: 1;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px);
}

.step-container {
    max-width: 500px;
    width: 100%;
}

.step-header {
    margin-bottom: 2rem;
    text-align: center;
}

.step-header h2 {
    font-size: 1.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.step-header p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    margin-top: -0.25rem;
}

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

.form-control,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(124, 93, 250, 0.1);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* Phone Input Group */
.phone-input-group {
    display: flex;
    gap: 0.5rem;
}

.country-select {
    min-width: 100px;
    flex-shrink: 0;
}

.phone-input {
    flex: 1;
}

/* Navigation Styles */
.navigation-container {
    padding: 1rem 2rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.875rem;
}

.nav-previous {
    color: var(--text-secondary);
    background-color: transparent;
}

.nav-previous:hover {
    color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.05);
}

.nav-next {
    background-color: var(--primary-color);
    color: white;
}

.nav-next:hover:not(:disabled) {
    background-color: var(--primary-dark);
    color: white;
}

.nav-next:disabled {
    background-color: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Checkbox and Radio Styles - New Design */
.form-check {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    border: 1px solid #D4C9B8;
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.form-check:hover {
    background-color: #F9F7F3;
    border-color: #B8A89E;
}

.form-check:has(.form-check-input:checked) {
    background-color: #E8E3F3;
    border-color: #7C6FB0;
}

.form-check-input {
    width: 28px;
    height: 28px;
    min-width: 28px;
    margin-right: 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 2px solid #D4C9B8;
    position: relative;
    background-color: white;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* Radio Buttons - Round */
.form-check-input[type="radio"] {
    border-radius: 50%;
}

/* Checkboxes - Square with rounded corners */
.form-check-input[type="checkbox"] {
    border-radius: 4px;
}

.form-check:hover .form-check-input {
    border-color: #B8A89E;
}

.form-check-input:checked {
    background-color: #7C6FB0;
    border-color: #7C6FB0;
}

/* Radio Button - Inner circle when checked */
.form-check-input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background-color: white;
    border-radius: 50%;
}

/* Checkbox - Checkmark when checked */
.form-check-input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}

.form-check-label {
    flex: 1;
    cursor: pointer;
    font-size: 15px;
    color: #2C2C2C;
    font-weight: 400;
    margin: 0;
    padding: 0;
}

.form-check:has(.form-check-input:checked) .form-check-label {
    font-weight: 500;
}

/* Brand Selection Grid */
.brand-grid {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
}

.brand-item {
    position: relative;
}

.brand-checkbox {
    position: absolute;
    opacity: 0;
}

.brand-label {
    display: block;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
}

.brand-label::before {
    content: '';
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 1rem;
    height: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background-color: white;
    transition: all 0.2s ease;
}

.brand-label::after {
    content: '✓';
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.brand-checkbox:checked+.brand-label {
    background-color: rgba(124, 93, 250, 0.1);
    border-color: var(--primary-color);
}

.brand-checkbox:checked+.brand-label::before {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.brand-checkbox:checked+.brand-label::after {
    opacity: 1;
}

.brand-label:hover {
    border-color: var(--primary-color);
    background-color: rgba(124, 93, 250, 0.05);
}

/* Success Message */
.success-message {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-color);
    color: #065f46;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Thank You Page */
.thank-you-container {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    padding: 2rem;
}

.thank-you-container h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.thank-you-container p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.btn-website {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    margin-bottom: 2rem;
}

.btn-website:hover {
    background-color: var(--primary-dark);
    color: white;
    text-decoration: none;
}

.new-entry-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
}

.new-entry-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Validation Styles */
.text-danger {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.is-invalid {
    border-color: var(--error-color);
}

/* Privacy Policy Link Styling */
.privacy-link {
    text-decoration: underline;
    color: var(--primary-color);
    transition: color 0.2s ease;
}

.privacy-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .phone-input-group {
        flex-direction: column;
    }

    .country-select {
        min-width: auto;
    }

    .navigation-container {
        padding: 1rem 1.5rem;
    }

    .step-container {
        padding: 0 1.5rem;
    }

    .form-container {
        padding: 1.5rem;
    }

    .welcome-content {
        padding: 0 1.5rem;
    }

    /* Fix title line-height on mobile */
    .step-header h2 {
        line-height: 1.3;
        font-size: 1.5rem;
    }

    /* Better spacing for form elements */
    .form-group {
        margin-bottom: 1.25rem;
    }

    /* Larger touch targets for mobile */
    .form-check {
        padding: 14px 16px;
        min-height: 52px;
    }

    .form-check-input {
        width: 24px;
        height: 24px;
        min-width: 24px;
    }

    /* Navigation buttons full width on mobile */
    .nav-button {
        padding: 0.875rem 1.25rem;
    }
}

/* Tablet-Layout (z.B. iPad quer) – Seiten allgemein breiter machen */
@media (min-width: 768px) and (max-width: 1200px) {

    .welcome-container,
    .form-container {
        padding: 3rem 4rem;
        /* mehr Luft links/rechts */
        min-height: calc(100vh - 80px);
    }

    .welcome-content,
    .step-container {
        max-width: 720px;
        /* vorher 500px -> breiter, wie im Design */
    }
}

/* Optional: etwas mehr Luft auf großen Desktops, ohne alles zu „riesig“ zu machen */
@media (min-width: 1200px) {

    .welcome-container,
    .form-container {
        padding: 3rem 5rem;
    }

    .welcome-content,
    .step-container {
        max-width: 640px;
        /* leicht breiter als vorher, aber noch „card“-Look */
    }
}

/* Group Headers for Lifestyle Options */
.lifestyle-group {
    margin-bottom: 1.5rem;
}

.lifestyle-group-header {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

/* Date Input Styling */
input[type="date"] {
    position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
}

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Accessibility - Enhanced Focus States */
.form-control:focus-visible,
.form-select:focus-visible,
.btn:focus-visible,
.nav-button:focus-visible {
    outline: 2px solid #7C6FB0;
    outline-offset: 2px;
}

.form-check:focus-within {
    outline: 2px solid #7C6FB0;
    outline-offset: 2px;
}

.form-check-input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 111, 176, 0.3);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-check-input {
        border-width: 3px;
    }

    .form-control,
    .form-select {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Content Section Styling */
.content-section {
    margin-top: 1rem;
}

.content-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.content-section p strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Consent Section Styling */
.consent-section {
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid #E5E0D5;
}

.consent-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Brand Selection Counter */
.selection-counter {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: rgba(124, 111, 176, 0.1);
    border-radius: var(--border-radius);
}

.selection-counter strong {
    color: #7C6FB0;
}

/* Smooth Page Transitions */
.step-container {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}