* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #8b5a6b;
    --primary-light: #a67285;
    --primary-dark: #6d4555;
    --accent: #d4a574;
    --accent-light: #e8c9a8;
    --bg: #faf8f5;
    --bg-card: #ffffff;
    --text: #3d3d3d;
    --text-light: #6b6b6b;
    --text-lighter: #9a9a9a;
    --border: #e8e4df;
    --success: #5a8b6a;
    --error: #c45c5c;
    --record-red: #e53935;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
}

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

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero */
.hero {
    text-align: center;
    padding: 60px 20px 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    margin: 0 -20px;
    color: white;
}

.hero-label {
    display: inline-block;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.9;
    margin-bottom: 12px;
}

.hero h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2.2rem, 8vw, 3.2rem);
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.2;
}

.hero-date {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Form Section */
.form-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px 32px;
    margin: -20px 0 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.intro {
    text-align: center;
    margin-bottom: 36px;
}

.intro h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.intro p {
    color: var(--text-light);
    max-width: 480px;
    margin: 0 auto;
}

/* Form */
form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

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

.field-hint {
    font-size: 0.85rem;
    color: var(--text-lighter);
    margin-top: -4px;
}

input[type="text"],
textarea {
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--bg);
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(139, 90, 107, 0.1);
}

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

.char-count {
    font-size: 0.8rem;
    color: var(--text-lighter);
    text-align: right;
}

/* Video Recorder */
.video-recorder {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
}

.recorder-preview {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recorder-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recorder-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.recorder-overlay:hover {
    background: rgba(0, 0, 0, 0.5);
}

.recorder-overlay.hidden {
    display: none;
}

.camera-icon {
    width: 48px;
    height: 48px;
    opacity: 0.9;
}

.recorder-overlay span {
    font-size: 0.95rem;
    opacity: 0.9;
}

.recording-indicator {
    position: absolute;
    top: 16px;
    left: 16px;
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 14px;
    border-radius: 20px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.recording-indicator.active {
    display: flex;
}

.rec-dot {
    width: 10px;
    height: 10px;
    background: var(--record-red);
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.rec-time {
    font-variant-numeric: tabular-nums;
}

.rec-limit {
    opacity: 0.6;
}

.recorder-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: #222;
}

.recorder-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    background: #444;
    color: white;
}

.recorder-btn:hover {
    background: #555;
}

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

.recorder-btn.record-btn {
    background: var(--record-red);
}

.recorder-btn.record-btn:hover {
    background: #c62828;
}

.record-circle {
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
}

.recorder-btn.stop-btn {
    background: var(--record-red);
}

.recorder-btn.stop-btn:hover {
    background: #c62828;
}

.recorder-status {
    padding: 0 16px 16px;
    text-align: center;
    font-size: 0.85rem;
    color: #aaa;
    min-height: 20px;
}

.recorder-status.success {
    color: var(--success);
}

.recorder-status.error {
    color: var(--error);
}

/* Or Divider */
.or-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 16px 0;
    color: var(--text-lighter);
    font-size: 0.85rem;
}

.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* File Upload */
.file-upload {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
}

.file-upload.compact {
    padding: 20px 16px;
}

.file-upload:hover,
.file-upload.dragover {
    border-color: var(--primary-light);
    background: rgba(139, 90, 107, 0.03);
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.upload-icon {
    width: 40px;
    height: 40px;
    color: var(--primary-light);
}

.upload-icon.small {
    width: 28px;
    height: 28px;
}

.upload-text {
    font-weight: 500;
    color: var(--text);
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text-lighter);
}

.file-selected {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 500;
}

.file-selected:empty {
    display: none;
}

.file-selected + .file-upload-content {
    opacity: 0.5;
}

/* Progress */
.progress-container {
    display: none;
    flex-direction: column;
    gap: 8px;
}

.progress-container.active {
    display: flex;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
}

/* Submit Button */
.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
    margin-top: 8px;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 90, 107, 0.35);
}

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

.btn-icon {
    width: 20px;
    height: 20px;
}

/* Success */
.success-message {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    gap: 16px;
}

.success-message.active {
    display: flex;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: rgba(90, 139, 106, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon svg {
    width: 40px;
    height: 40px;
    color: var(--success);
}

.success-message h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.8rem;
    color: var(--success);
}

.success-message p {
    color: var(--text-light);
}

.submit-another-btn {
    padding: 12px 24px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    margin-top: 8px;
}

.submit-another-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

form.hidden {
    display: none;
}

/* Footer */
footer {
    text-align: center;
    padding: 24px;
    color: var(--text-lighter);
    font-size: 0.9rem;
}

/* Error state */
.error-message {
    background: rgba(196, 92, 92, 0.1);
    color: var(--error);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.error-message.active {
    display: block;
}

/* Responsive */
@media (max-width: 600px) {
    .hero {
        padding: 48px 16px 32px;
    }

    .form-section {
        padding: 32px 20px;
        margin: -16px -4px 32px;
        border-radius: 12px;
    }

    .intro h2 {
        font-size: 1.5rem;
    }

    .file-upload {
        padding: 24px 16px;
    }

    .recorder-controls {
        flex-wrap: wrap;
    }

    .recorder-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}
