/* Vaani UI — macOS-native feel */

:root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --text: #1d1d1f;
    --text-secondary: #86868b;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --success: #34c759;
    --error: #ff3b30;
    --warning: #ff9500;
    --border: #d2d2d7;
    --input-bg: #ffffff;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --radius: 10px;
    --radius-sm: 6px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1c1c1e;
        --surface: #2c2c2e;
        --text: #f5f5f7;
        --text-secondary: #98989d;
        --accent: #0a84ff;
        --accent-hover: #409cff;
        --border: #48484a;
        --input-bg: #3a3a3c;
        --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    user-select: none;
    height: 100vh;
}

/* Layout */
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 24px;
}

.content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

/* Steps indicator */
.steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.3s, transform 0.3s;
}

.step-dot.active {
    background: var(--accent);
    transform: scale(1.25);
}

.step-dot.completed {
    background: var(--success);
}

/* Step content */
.step {
    display: none;
    animation: fadeIn 0.25s ease;
}

.step.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.step.left-align {
    align-items: stretch;
    text-align: left;
}

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

h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 6px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
    max-width: 420px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 980px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    gap: 6px;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: default;
}

.btn-secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* Navigation */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    flex-shrink: 0;
}

.nav-spacer {
    flex: 1;
}

/* Form elements */
.form-group {
    width: 100%;
    max-width: 420px;
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

input:focus,
select:focus {
    border-color: var(--accent);
}

.input-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.input-hint a {
    color: var(--accent);
    text-decoration: none;
}

/* Status badges */
.status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 980px;
}

.status-ok {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
}

.status-missing {
    background: rgba(255, 59, 48, 0.15);
    color: var(--error);
}

/* Mic level meter */
.level-meter {
    width: 100%;
    max-width: 420px;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0;
}

.level-meter-fill {
    height: 100%;
    background: var(--success);
    border-radius: 4px;
    transition: width 0.08s ease-out;
    width: 0%;
}

.level-meter-fill.hot {
    background: var(--warning);
}

/* Permission checklist */
.perm-list {
    list-style: none;
    width: 100%;
    max-width: 420px;
    text-align: left;
}

.perm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

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

.perm-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.perm-icon.ok {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
}

.perm-icon.missing {
    background: rgba(255, 59, 48, 0.15);
    color: var(--error);
}

.perm-label {
    flex: 1;
    font-size: 14px;
}

.perm-action {
    font-size: 12px;
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
}

.perm-grant-btn {
    flex-shrink: 0;
}

.btn-granted {
    opacity: 0.5;
    cursor: default;
}

/* Settings section header */
.setting-section-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 16px 0 6px;
    margin-top: 4px;
}

/* Settings tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    gap: 0;
}

.tab {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* Settings layout */
.settings-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.settings-content {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-label {
    font-size: 14px;
}

.setting-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Toggle switch */
.toggle {
    position: relative;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
}

.toggle input {
    display: none;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-slider::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle-slider {
    background: var(--success);
}

.toggle input:checked + .toggle-slider::after {
    transform: translateX(18px);
}

/* Hotkey display */
.hotkey-display {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: "SF Mono", "Menlo", monospace;
    font-size: 14px;
    min-width: 80px;
    justify-content: center;
}

.hotkey-display.recording {
    border-color: var(--accent);
    background: rgba(10, 132, 255, 0.08);
    animation: pulse 1s infinite;
}

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

/* App icon placeholder */
.app-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent), #5856d6);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 16px;
    color: white;
}

/* Inline feedback */
.feedback {
    font-size: 13px;
    margin-top: 4px;
    min-height: 18px;
}

.feedback.success {
    color: var(--success);
}

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

/* About section */
.about-info {
    text-align: center;
    padding: 20px 0;
}

.about-info h2 {
    margin-bottom: 4px;
}

.about-version {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 20px;
}

.about-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}