:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-main: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 3rem auto;
    padding: 0 1rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.22rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.glass-panel, .voice-card, .auth-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0,0,0,0.03);
    margin-bottom: 2rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

/* Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.single-layout {
    display: flex;
    justify-content: center;
    max-width: 700px;
    margin: 0 auto;
}

.radio-group-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.radio-item:hover {
    border-color: var(--primary);
    background: #f0f7ff;
}

.radio-item input {
    width: auto;
}


/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fafafa;
    font-size: 0.95rem;
    transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

/* Buttons */
.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.3);
}

.outline-btn {
    background: white;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.outline-btn:hover {
    background: #f9fafb;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fcfcfc;
}

.drop-zone:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.02);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.hidden {
    display: none !important;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 18px;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    width: 100%;
    margin-bottom: 0.5rem;
}

.modal-body {
    margin-top: 1rem;
}

.modal-footer {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.match-list {
    max-height: 250px;
    overflow-y: auto;
}

.match-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.role-label {
    font-weight: 600;
    color: var(--text-main);
}

.voice-match-select {
    width: auto;
    min-width: 180px;
}

/* Dialogue Layout */
.dialogue-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.dialogue-buttons button {
    flex: none;
    min-width: 180px;
}

/* Progress Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(8px);
}

.progress-container {
    width: 300px;
    background: #e2e8f0;
    border-radius: 10px;
    height: 8px;
    margin: 1.5rem 0;
    overflow: hidden;
}

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

.status-text {
    font-weight: 600;
    text-align: center;
}

/* Results Box */
.result-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.download-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    margin-top: 1rem;
    display: inline-block;
}

#toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    z-index: 4000;
}

.flex-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 10px;
    flex-shrink: 0;
}

.ml-2 {
    margin-left: 0.5rem;
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

