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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #111118;
    color: #d4d4dc;
    font-size: 17px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navigation */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 48px;
}

.nav-brand {
    font-size: 18px;
    font-weight: 600;
    color: #d4d4dc;
    text-decoration: none;
    letter-spacing: -0.3px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    font-size: 15px;
    color: #6b6b7b;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #d4d4dc;
}

/* Flash messages */
.flash-messages {
    margin-bottom: 24px;
}

.flash {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 15px;
}

.flash-error {
    background: #1f1418;
    color: #e8a0a0;
    border: 1px solid #2a1a1a;
}

.flash-success {
    background: #141f18;
    color: #a0e8b8;
    border: 1px solid #1a2a1e;
}

/* Auth */
.auth-container {
    max-width: 360px;
    margin: 80px auto;
    text-align: center;
}

.auth-container h1 {
    font-size: 28px;
    font-weight: 600;
    color: #e8e8f0;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    color: #6b6b7b;
    font-size: 16px;
    margin-bottom: 40px;
}

.auth-form {
    text-align: left;
}

.auth-link {
    margin-top: 32px;
    font-size: 15px;
    color: #6b6b7b;
}

.auth-link a {
    color: #8b9cf7;
    text-decoration: none;
}

.auth-link a:hover {
    color: #a8b5ff;
}

/* Forms */
.form-group {
    margin-bottom: 28px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #6b6b7b;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid #2a2a35;
    border-radius: 8px;
    background: #18181f;
    color: #d4d4dc;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #4a4a5a;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.15s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: #3a3af0;
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    opacity: 0.88;
}

.btn-secondary {
    background: #1e1e28;
    color: #9090a0;
    border: 1px solid #2a2a35;
}

.btn-secondary:hover {
    border-color: #3a3a4a;
    color: #d4d4dc;
}

.btn-large {
    padding: 16px 36px;
    font-size: 17px;
}

/* Dashboard */
.dashboard h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.dashboard-intro {
    color: #6b6b7b;
    font-size: 16px;
    margin-bottom: 36px;
}

.dashboard-section {
    margin-bottom: 40px;
}

.dashboard-section h2 {
    font-size: 14px;
    font-weight: 500;
    color: #6b6b7b;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.start-option {
    margin: 0;
}

.session-card-action {
    width: 100%;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    border: 1px solid #2a2a35;
}

.session-card-action:hover {
    border-color: #5a5af0;
    background: #1a1a28;
}

.session-meta {
    font-size: 13px;
    color: #5a5a6a;
}

/* File upload */
.import-form,
.custom-form {
    background: #18181f;
    border: 1px solid #2a2a35;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 8px;
}

.file-upload-area {
    position: relative;
    border: 2px dashed #2a2a35;
    border-radius: 8px;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: #5a5af0;
    background: #1a1a28;
}

.file-upload-area.has-file {
    border-color: #4a8a5a;
    border-style: solid;
}

.file-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-label {
    font-size: 15px;
    color: #6b6b7b;
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.card-option {
    cursor: pointer;
}

.card-option input {
    display: none;
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 12px;
    background: #18181f;
    border: 1px solid #2a2a35;
    border-radius: 10px;
    transition: border-color 0.2s;
}

.card-option input:checked + .card-content {
    border-color: #5a5af0;
    background: #1a1a28;
}

.card-title {
    font-size: 16px;
    font-weight: 500;
}

.card-count {
    font-size: 13px;
    color: #5a5a6a;
    margin-top: 4px;
}

.depth-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.depth-option {
    cursor: pointer;
}

.depth-option input {
    display: none;
}

.depth-content {
    display: flex;
    flex-direction: column;
    padding: 14px 18px;
    background: #18181f;
    border: 1px solid #2a2a35;
    border-radius: 10px;
    transition: border-color 0.2s;
}

.depth-option input:checked + .depth-content {
    border-color: #5a5af0;
    background: #1a1a28;
}

.depth-title {
    font-size: 16px;
    font-weight: 500;
}

.depth-desc {
    font-size: 14px;
    color: #5a5a6a;
    margin-top: 2px;
}

.custom-textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid #2a2a35;
    border-radius: 8px;
    background: #18181f;
    color: #d4d4dc;
    resize: vertical;
    min-height: 140px;
    line-height: 1.7;
    font-family: inherit;
    margin-top: 8px;
}

.custom-textarea:focus {
    outline: none;
    border-color: #4a4a5a;
}

.session-form .btn {
    margin-top: 32px;
}

/* Active sessions */
.active-sessions {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid #1e1e28;
}

.active-sessions h2 {
    font-size: 16px;
    font-weight: 500;
    color: #6b6b7b;
    margin-bottom: 14px;
}

.session-progress {
    font-size: 13px;
    color: #5a5a6a;
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
}

.session-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #18181f;
    border: 1px solid #2a2a35;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    margin-bottom: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.session-card:hover {
    border-color: #4a4a5a;
}

.session-info {
    font-weight: 500;
}

/* Preview / Edit questions */
.preview-page h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.preview-intro {
    color: #6b6b7b;
    font-size: 15px;
    margin-bottom: 28px;
}

.question-edit-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.question-edit-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.question-edit-num {
    font-size: 13px;
    color: #4a4a5a;
    min-width: 24px;
    text-align: right;
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
}

.question-edit-input {
    flex: 1;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #2a2a35;
    border-radius: 8px;
    background: #18181f;
    color: #d4d4dc;
    font-family: inherit;
    transition: border-color 0.2s;
}

.question-edit-input:focus {
    outline: none;
    border-color: #4a4a5a;
}

.question-delete-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #3a3a4a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.question-delete-btn:hover {
    color: #e8a0a0;
}

.question-delete-btn svg {
    width: 16px;
    height: 16px;
}

.preview-buttons {
    margin-bottom: 32px;
}

.preview-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.preview-actions .btn-primary {
    width: 100%;
}

.btn-restore {
    color: #4a4a5a;
    font-size: 14px;
}

.btn-restore:hover {
    color: #e8a0a0;
}

/* Record page */
.record-page {
    padding-bottom: 60px;
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.record-count {
    font-size: 14px;
    color: #4a4a5a;
}

.record-edit-link {
    font-size: 14px;
    color: #4a4a5a;
    text-decoration: none;
}

.record-edit-link:hover {
    color: #8b9cf7;
}

.record-current {
    text-align: center;
    margin-bottom: 48px;
}

.record-question {
    font-size: 22px;
    font-weight: 400;
    line-height: 1.5;
    color: #e8e8f0;
    margin-bottom: 8px;
}

.record-hint-text {
    font-size: 15px;
    color: #4a4a5a;
    margin-bottom: 40px;
    font-style: italic;
}

.record-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.record-timer {
    font-size: 22px;
    font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
    color: #4a4a5a;
    margin-bottom: 24px;
    min-height: 28px;
    font-weight: 400;
}

.record-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid #e05050;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.1s;
}

.record-btn:active {
    transform: scale(0.94);
}

.record-btn-inner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e05050;
    transition: border-radius 0.2s, width 0.2s, height 0.2s;
}

.record-btn.recording .record-btn-inner {
    width: 22px;
    height: 22px;
    border-radius: 4px;
}

.record-btn.recording {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(224, 80, 80, 0.3); }
    70% { box-shadow: 0 0 0 14px rgba(224, 80, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(224, 80, 80, 0); }
}

.record-status {
    margin-top: 16px;
    font-size: 14px;
    color: #4a4a5a;
}

.record-status.error {
    color: #e8a0a0;
}

.record-status.done {
    color: #a0e8b8;
}

.btn-next {
    margin-top: 20px;
    width: 100%;
}

.record-done {
    text-align: center;
    padding: 40px 0;
}

.record-done h2 {
    font-size: 22px;
    color: #e8e8f0;
    font-weight: 600;
    margin-bottom: 8px;
}

.record-done p {
    color: #6b6b7b;
    font-size: 16px;
    margin-bottom: 28px;
}

/* Completed recordings list */
.completed-recordings {
    border-top: 1px solid #1e1e28;
    padding-top: 24px;
}

.completed-recordings h3 {
    font-size: 14px;
    font-weight: 500;
    color: #4a4a5a;
    margin-bottom: 12px;
}

.completed-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #1e1e28;
}

.completed-item:last-child {
    border-bottom: none;
}

.completed-question {
    flex: 1;
    font-size: 14px;
    color: #6b6b7b;
    line-height: 1.4;
}

.completed-index {
    color: #4a4a5a;
}

.completed-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.completed-duration {
    font-size: 13px;
    color: #4a4a5a;
    font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
}

.delete-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #3a3a4a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.delete-btn:hover {
    color: #e8a0a0;
}

.delete-btn svg {
    width: 16px;
    height: 16px;
}

/* Dashboard alt */
.dashboard-alt {
    margin-top: 16px;
    text-align: center;
}

.btn-text {
    background: none;
    border: none;
    color: #4a4a5a;
    font-size: 15px;
    cursor: pointer;
    padding: 8px;
}

.btn-text:hover {
    color: #8b9cf7;
}

/* History */
.history h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 28px;
    letter-spacing: -0.3px;
}

.history-empty {
    color: #5a5a6a;
    font-size: 16px;
}

.history-session {
    margin-bottom: 24px;
    background: #18181f;
    border: 1px solid #2a2a35;
    border-radius: 10px;
    padding: 18px 20px;
}

.history-session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #1e1e28;
}

.history-category {
    font-size: 16px;
    font-weight: 600;
    color: #d4d4dc;
}

.history-meta {
    font-size: 13px;
    color: #4a4a5a;
}

.history-recordings {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid #1e1e28;
}

.history-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.history-question {
    flex: 1;
    font-size: 15px;
    line-height: 1.5;
    color: #9090a0;
}

.history-index {
    color: #4a4a5a;
    margin-right: 6px;
    font-size: 13px;
}

.history-duration {
    font-size: 13px;
    color: #4a4a5a;
    white-space: nowrap;
    font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
}

.history-no-file {
    font-size: 13px;
    color: #3a3a4a;
    white-space: nowrap;
}

.play-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    border: 1.5px solid #4a4a5a;
    background: transparent;
    color: #8090a0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, color 0.2s;
}

.play-btn:hover {
    border-color: #8b9cf7;
    color: #8b9cf7;
}

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

.history-audio {
    display: none;
}

/* Responsive */
@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .record-question {
        font-size: 22px;
    }

    .container {
        padding: 0 18px;
    }
}
