:root {
    --primary: #000000;
    --primary-light: #333333;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F2F2F7;
    --bg-surface: #FFFFFF;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    --text-primary: #000000;
    --text-secondary: #8E8E93;
    --text-light: #C7C7CC;
    --border-color: #E5E5EA;
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --border-radius-lg: 24px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 20px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 40px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-black: 800;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
    font-weight: var(--font-weight-regular);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    max-width: 100%;
    margin: 0 auto;
    height: 100vh;
    background: var(--bg-primary);
    position: relative;
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top, 4px);
    padding-bottom: env(safe-area-inset-bottom, 12px);
}

.screen {
    display: none;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
    padding-top: env(safe-area-inset-top, 6px);
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.auth-container {
    flex: 1;
    padding: var(--space-3xl) var(--space-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--bg-primary);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.app-brand {
    text-align: center;
    margin-bottom: var(--space-3xl);
    flex-shrink: 0;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    font-size: 32px;
    color: var(--primary);
}

.app-title {
    font-size: 32px;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-xs);
    letter-spacing: -0.5px;
}

.app-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: var(--font-weight-regular);
}

.auth-form {
    width: 100%;
    max-width: 320px;
    flex-shrink: 0;
}

.input-field {
    position: relative;
    margin-bottom: var(--space-lg);
}

.input-field i {
    position: absolute;
    left: var(--space-lg);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 18px;
    z-index: 2;
}

.input-field input {
    width: 100%;
    padding: var(--space-lg) var(--space-lg) var(--space-lg) 56px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-family: var(--font-family);
    color: var(--text-primary);
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.input-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}


.phone-field input {
    padding-left: 88px;
}

.phone-prefix {
    position: absolute;
    left: 56px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: var(--font-weight-regular);
    z-index: 2;
    pointer-events: none;
}

.input-field input#phone {
    letter-spacing: 0.5px;
}

.input-field input#phone::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

.btn-auth {
    width: 100%;
    padding: var(--space-lg);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 17px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: var(--space-xl);
}

.btn-auth:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.auth-note {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: var(--space-lg);
    line-height: 1.4;
}

.top-section {
    padding: var(--space-xl) var(--space-xl) var(--space-lg);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.welcome-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    text-align: center;
}

.welcome-icon {
    width: 50px;
    height: 50px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    font-size: 20px;
    color: var(--text-primary);
}

.welcome-card h2 {
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.welcome-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: var(--space-md);
}

.level-number {
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
}

.stats-mini {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.stat-mini {
    text-align: center;
}

.stat-mini-value {
    font-size: 18px;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: 2px;
}

.stat-mini-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.main-content,
.categories-container,
.stats-container,
.completion-container {
    flex: 1;
    padding: 8px var(--space-xl) 0; 
    padding-bottom: 70px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    flex-shrink: 0;
}

.action-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    flex: 1;
    min-height: 80px;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.action-card.primary {
    background: var(--primary);
    color: white;
    border: none;
}

.action-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-md);
    font-size: 18px;
    color: var(--primary);
    flex-shrink: 0;
}

.action-card.primary .action-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.action-content {
    flex: 1;
    min-width: 0;
}

.action-content h3 {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-content p {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-card.primary .action-content p {
    color: rgba(255, 255, 255, 0.8);
}

.square-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    flex: 1;
    align-content: start;
}

.square-menu-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    height: 100%;
}

.square-menu-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary);
}

.square-menu-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-sm);
    font-size: 18px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.square-menu-card h4 {
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    line-height: 1.2;
    text-align: center;
}

.bottom-nav-simple {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 4px var(--space-md);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    flex-shrink: 0;
    min-height: 48px;
    position: fixed;  
    bottom: 0;        
    left: 0;          
    right: 0;         
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: 0;
}

.bottom-nav-simple .nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-xs);
    transition: color 0.2s ease;
    position: relative;
    flex: 1;
    min-height: 44px;
    justify-content: center;
}

.bottom-nav-simple .nav-item.active {
    color: var(--primary);
}

.bottom-nav-simple .nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.page-header {
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    flex-shrink: 0;
    min-height: 64px;
}

.page-header h2 {
    font-size: 20px;
    font-weight: var(--font-weight-semibold);
    flex: 1;
    text-align: center;
    color: var(--text-primary);
}

.btn-back {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    padding: var(--space-xs);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

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

.categories-grid-full {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.category-card-full {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    aspect-ratio: 1/1;
}

.category-card-full:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary);
}

.category-icon-full {
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
    font-size: 20px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.category-card-full h3 {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 4px;
    color: var(--text-primary);
}

.category-card-full p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.general-test-btn {
    background: var(--primary);
    border: none;
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    color: white;
}

.general-test-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.general-test-btn h3 {
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 4px;
}

.general-test-btn p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.3;
}

.quiz-header {
    background: var(--bg-primary);
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    min-height: 64px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-header-inline {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
}

.page-header-inline .btn-back {
    flex-shrink: 0;
}

.page-header-inline .quiz-progress {
    flex: 1;
    min-width: 0;
}

.quiz-progress {
    margin-top: 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
    font-size: 13px;
}

.category-tag {
    background: var(--bg-secondary);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--border-radius-sm);
    font-weight: var(--font-weight-medium);
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.progress-text {
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    font-size: 12px;
    flex-shrink: 0;
}

.progress-bar {
    height: 3px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

.question-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.question-scroll-area {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 2px;
}

.question-image-container {
    width: 100%;
    margin-bottom: var(--space-lg);
    flex-shrink: 0;
    display: none;
}

.question-image-container.has-image {
    display: block;
}

.question-image-wrapper {
    width: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    max-height: 350px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.question-image-wrapper:hover {
    transform: scale(1.01);
}

.question-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
    display: block;
    transition: opacity 0.3s ease;
}

.image-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
}

.image-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.question-image-wrapper.horizontal {
    aspect-ratio: 16/9;
    max-height: 300px;
}

.question-image-wrapper.vertical {
    aspect-ratio: 3/4;
    max-height: 400px;
}

.question-image-wrapper.square {
    aspect-ratio: 1/1;
    max-height: 280px;
}

.image-error {
    width: 100%;
    height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    padding: var(--space-lg);
    text-align: center;
}

.image-error i {
    font-size: 48px;
    margin-bottom: var(--space-sm);
    opacity: 0.3;
}

.image-error span {
    font-size: 14px;
    opacity: 0.7;
}

.question-text-container {
    margin-bottom: var(--space-lg);
    flex-shrink: 0;
}

.question-text {
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    line-height: 1.4;
    text-align: center;
    color: var(--text-primary);
    padding: var(--space-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.options-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.options-title {
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    flex-shrink: 0;
}

.options-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-sm);
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 2px;
    min-height: 0;
}

.option-btn {
    padding: var(--space-lg) var(--space-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-weight: var(--font-weight-regular);
    display: flex;
    align-items: center;
    min-height: 50px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
    position: relative;
}

.option-btn:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

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

.option-btn.correct {
    background: rgba(52, 199, 89, 0.1);
    border-color: #34C759;
    color: #2e8b47;
    font-weight: var(--font-weight-medium);
}

.option-btn.incorrect {
    background: rgba(255, 59, 48, 0.1);
    border-color: #FF3B30;
    color: #d32f2f;
    font-weight: var(--font-weight-medium);
}

.option-btn[data-correct="true"] {
    background: rgba(52, 199, 89, 0.1);
    border-color: #34C759;
    color: #2e8b47;
    font-weight: var(--font-weight-medium);
}

.finish-test-btn {
    padding: var(--space-lg) var(--space-md);
    background: var(--primary);
    border: 1px solid var(--primary);
    border-radius: var(--border-radius);
    font-size: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-weight: var(--font-weight-semibold);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 55px;
    min-height: 55px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
    position: relative;
    margin-top: 10px;
}

.finish-test-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

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

.finish-test-btn i {
    margin-right: var(--space-sm);
    font-size: 14px;
}

.result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.result-overlay.active {
    opacity: 1;
    visibility: visible;
}

.result-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--space-xl);
    max-width: 400px;
    width: 100%;
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

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

.result-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.result-icon {
    width: 50px;
    height: 50px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.result-header h3 {
    font-size: 20px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.result-body {
    margin-bottom: var(--space-lg);
}

.correct-answer {
    font-size: 16px;
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    border-left: none;
}

.explanation {
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
}

.btn-continue {
    width: 100%;
    padding: var(--space-md);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

.stats-overview {
    margin-bottom: var(--space-lg);
}

.overview-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.overview-icon {
    width: 50px;
    height: 50px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-md);
    font-size: 20px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.overview-content h3 {
    font-size: 20px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.overview-content p {
    color: var(--text-secondary);
    font-size: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.stat-item-large {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-progress {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: var(--space-lg);
}

.category-progress h3 {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    flex-shrink: 0;
}

.categories-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    flex: 1;
    grid-auto-rows: minmax(70px, auto);
}

.category-stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-md);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
}

.category-stat-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    font-size: 20px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.category-stat-card h4 {
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 2px;
    color: var(--text-primary);
    line-height: 1.2;
}

.category-stat-numbers {
    font-size: 18px;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-top: 2px;
}

.completion-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-xl);
    font-size: 32px;
    color: var(--text-primary);
    animation: scaleIn 0.5s ease;
    flex-shrink: 0;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.completion-content h2 {
    font-size: 28px;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-md);
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.completion-message {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: var(--space-xl);
    max-width: 400px;
}

.completion-actions {
    display: grid;
    gap: var(--space-md);
    width: 100%;
    max-width: 320px;
}

.btn-primary {
    width: 100%;
    padding: var(--space-md);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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


.fullscreen-image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    opacity: 0;
    animation: fadeIn 0.2s ease forwards;
    touch-action: pan-x pan-y pinch-zoom;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.fullscreen-image-container {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    max-height: 90vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: -10px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.fullscreen-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    padding: 0;
    pointer-events: none;  
}

.fullscreen-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    box-shadow: none;
    pointer-events: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .fullscreen-close {
        top: 10px;
        right: 10px;
        width: 50px;
        height: 50px;
        font-size: 22px;
        background: rgba(0, 0, 0, 0.5);
    }
    
    .fullscreen-image-container {
        width: 95%;
        height: 95%;
    }
}

@media (max-width: 480px) {
    :root {
        --space-xs: 6px;
        --space-sm: 10px;
        --space-md: 14px;
        --space-lg: 18px;
        --space-xl: 22px;
        --space-2xl: 28px;
        --space-3xl: 36px;
    }
    
    .auth-container {
        padding: var(--space-2xl) var(--space-lg);
    }
    
    .app-title {
        font-size: 28px;
    }
    
    .app-subtitle {
        font-size: 14px;
    }
    
    .input-field input {
        padding: var(--space-md) var(--space-md) var(--space-md) 48px;
        font-size: 15px;
    }
    
    .input-field i {
        left: var(--space-md);
        font-size: 16px;
    }
    
    .phone-field input {
        padding-left: 80px;
    }
    
    .phone-prefix {
        left: 48px;
        font-size: 15px;
    }
    
    .btn-auth {
        padding: var(--space-md);
        font-size: 16px;
    }
    
    .top-section {
        padding: var(--space-lg);
    }
    
    .welcome-card {
        padding: var(--space-md);
    }
    
    .welcome-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .welcome-card h2 {
        font-size: 16px;
    }
    
    .welcome-card p {
        font-size: 13px;
    }
    
    .stat-mini-value {
        font-size: 16px;
    }
    
    .stat-mini-label {
        font-size: 10px;
    }
    
    .main-content,
    .categories-container,
    .stats-container,
    .completion-container {
        padding: 12px var(--space-md) 0;
        padding-bottom: 70px;
    }
    
    .quick-actions {
        gap: var(--space-sm);
        margin-bottom: var(--space-lg);
    }
    
    .action-card {
        padding: var(--space-sm);
        min-height: 70px;
    }
    
    .action-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
        margin-right: var(--space-sm);
    }
    
    .action-content h3 {
        font-size: 15px;
    }
    
    .action-content p {
        font-size: 12px;
    }
    
    .square-menu-grid {
        gap: var(--space-sm);
    }
    
    .square-menu-card {
        padding: var(--space-sm);
        min-height: 90px;
    }
    
    .square-menu-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
        margin-bottom: var(--space-xs);
    }
    
    .square-menu-card h4 {
        font-size: 13px;
    }
    
    .bottom-nav-simple {
        padding: 4px var(--space-sm);
        min-height: 48px;
        padding-bottom: calc(var(--space-xs) + env(safe-area-inset-bottom, 0px));
    }
    
    .bottom-nav-simple .nav-item i {
        font-size: 18px;
    }
    
    .page-header {
        padding: var(--space-md) var(--space-lg);
        min-height: 56px;
    }
    
    .page-header h2 {
        font-size: 18px;
    }
    
    .categories-grid-full {
        gap: var(--space-sm);
    }
    
    .category-card-full {
        padding: var(--space-md);
        min-height: 100px;
    }
    
    .category-icon-full {
        width: 36px;
        height: 36px;
        font-size: 16px;
        margin-bottom: var(--space-sm);
    }
    
    .category-card-full h3 {
        font-size: 14px;
    }
    
    .category-card-full p {
        font-size: 12px;
    }
    
    .general-test-btn {
        padding: var(--space-md);
        min-height: 70px;
    }
    
    .general-test-btn h3 {
        font-size: 16px;
    }
    
    .general-test-btn p {
        font-size: 13px;
    }
    
    .quiz-header {
        padding: var(--space-md) var(--space-lg);
        min-height: 56px;
    }
    
    .question-scroll-area {
        padding: var(--space-md);
        padding-bottom: 2px;
    }
    
    .question-image-wrapper {
        min-height: 150px;
        max-height: 250px;
    }
    
    .question-image-wrapper.horizontal {
        max-height: 200px;
    }
    
    .question-image-wrapper.vertical {
        max-height: 300px;
    }
    
    .question-image-wrapper.square {
        max-height: 220px;
    }
    
    .question-text {
        font-size: 16px;
        padding: var(--space-sm);
    }
    
    .options-list {
        gap: 6px;
        margin-bottom: var(--space-sm);
    }
    
    .option-btn {
        padding: 10px;
        min-height: 45px;
        font-size: 14px;
    }
    
    .finish-test-btn {
        padding: 10px;
        min-height: 50px;
        font-size: 14px;
        margin-top: 10px;
    }
    
    .result-card {
        padding: var(--space-lg);
    }
    
    .result-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .result-header h3 {
        font-size: 18px;
    }
    
    .stats-overview {
        margin-bottom: var(--space-lg);
    }
    
    .overview-card {
        padding: var(--space-md);
    }
    
    .overview-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .overview-content h3 {
        font-size: 18px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .categories-stats-grid {
        gap: 8px;
        grid-auto-rows: minmax(60px, auto);
    }
    
    .category-stat-card {
        padding: 8px;
        min-height: 80px;
    }
    
    .category-stat-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
        margin-bottom: 2px;
    }
    
    .category-stat-card h4 {
        font-size: 13px;
    }
    
    .category-stat-numbers {
        font-size: 16px;
    }
    
    .completion-container {
        padding: var(--space-xl) var(--space-lg);
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    }
    
    .completion-icon {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }
    
    .completion-content h2 {
        font-size: 24px;
    }
    
    .fullscreen-close {
        top: var(--space-sm);
        right: var(--space-sm);
        width: 40px;
        height: 40px;
    }
}

/* Модальное окно */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease;
    box-shadow: var(--shadow-lg);
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: var(--space-xs);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-secondary);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-body .input-field {
    margin-bottom: var(--space-md);
}

.modal-body .input-field:last-child {
    margin-bottom: 0;
}

.modal-body label {
    display: block;
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.modal-body input {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-family: var(--font-family);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.modal-body input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.error-message {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: var(--border-radius-sm);
    padding: var(--space-md);
    color: #d32f2f;
    font-size: 14px;
    margin-top: var(--space-md);
    display: none;
}

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

.modal-actions {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    flex: 1;
    padding: var(--space-md);
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    border-radius: var(--border-radius);
}

.btn-secondary {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--border-radius);  
    padding: var(--space-md);  
    font-size: 16px;  
    font-weight: var(--font-weight-semibold);  
    cursor: pointer;
    transition: all 0.2s ease;
}

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

#nameModal .modal-card {
    max-width: 350px;
}

#nameModal .modal-header {
    border-bottom: none;
    padding-bottom: 0;
}

#nameModal .modal-header h3 {
    font-size: 20px;
    text-align: center;
    width: 100%;
}

#nameModal .modal-body {
    padding-top: 0;
}

#nameModal .input-field {
    margin-top: 8px;
}

#nameModal .btn-primary {
    padding: 16px;
    font-size: 16px;
}

#nameModal.modal-overlay {
    backdrop-filter: blur(8px);
}

#nameModal .modal-card {
    animation: modalSlideUp 0.4s ease;
}

/* Стили для поля имени без иконки */
.name-field {
    margin-bottom: var(--space-lg);
}

.name-field input {
    width: 100%;
    padding: var(--space-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-family: var(--font-family);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.name-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

@supports (padding: max(0px)) {
    .quiz-footer {
        padding-bottom: max(12px, env(safe-area-inset-bottom, 20px));
    }
}

@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .quiz-footer {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 1000 !important;
    }
}

@media (hover: none) {
    .option-btn:active,
    .square-menu-card:active,
    .action-card:active,
    .category-card-full:active,
    .category-stat-card:active,
    .finish-test-btn:active {
        transform: scale(0.98);
    }
    
    .btn-auth:active,
    .btn-continue:active,
    .btn-primary:active {
        transform: scale(0.98);
    }
    
    .question-image-wrapper:active {
        transform: scale(0.99);
    }
}

@media (hover: none) and (pointer: coarse) {
    .option-btn:hover {
        background: var(--bg-surface);
        border-color: var(--border-color);
    }
    
    .option-btn.correct:hover {
        background: rgba(52, 199, 89, 0.1);
        border-color: #34C759;
    }
    
    .option-btn.incorrect:hover {
        background: rgba(255, 59, 48, 0.1);
        border-color: #FF3B30;
    }
    
    .finish-test-btn:hover {
        background: var(--primary);
        border-color: var(--primary);
    }
}

.theory-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-xl);
    min-height: 60vh;
}

.theory-icon {
    width: 100px;
    height: 100px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-xl);
    font-size: 40px;
    color: var(--text-primary);
}

.theory-content h2 {
    font-size: 24px;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.theory-content p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--space-md);
    max-width: 300px;
}

.theory-subtext {
    font-size: 14px;
    color: var(--text-light);
    margin-top: var(--space-xl);
}

.user-info-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.user-info-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-lg);
    font-size: 28px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.user-info-content h3 {
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.user-info-content p {
    color: var(--text-secondary);
    font-size: 14px;
}

.account-menu {
    margin-bottom: var(--space-xl);
}

.account-menu h3 {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.menu-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-sm);
}

.menu-item-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.menu-item-btn:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

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

.menu-item-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-md);
    font-size: 16px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.menu-item-content {
    flex: 1;
    text-align: left;
}

.menu-item-content h4 {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 2px;
    color: var(--text-primary);
}

.menu-item-content p {
    font-size: 13px;
    color: var(--text-secondary);
}

.menu-item-btn .fa-chevron-right {
    color: var(--text-light);
    font-size: 14px;
    margin-left: var(--space-sm);
}

.logout-btn {
    border-color: #FF3B30;
    background: rgba(255, 59, 48, 0.05);
}

.logout-btn .menu-item-icon {
    background: rgba(255, 59, 48, 0.1);
    color: #FF3B30;
}

.logout-btn h4 {
    color: #FF3B30;
}

.info-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.info-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
    font-size: 28px;
    color: var(--text-primary);
}

.info-card h3 {
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.info-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--space-md);
}

.links-list {
    display: grid;
    gap: var(--space-sm);
}

.link-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.link-item:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.link-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-md);
    font-size: 16px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.link-content {
    flex: 1;
    text-align: left;
}

.link-content h4 {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 2px;
    color: var(--text-primary);
}

.link-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.link-item .fa-chevron-right {
    color: var(--text-light);
    font-size: 14px;
    margin-left: var(--space-sm);
}

.social-links {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.social-links h4 {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.social-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    padding: var(--space-sm);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
    min-width: 70px;
}

.social-icon:hover {
    background: var(--bg-secondary);
}

.social-icon i {
    font-size: 24px;
    margin-bottom: var(--space-xs);
    color: var(--primary);
}

.social-icon span {
    font-size: 12px;
    color: var(--text-secondary);
}

body {
    touch-action: none;
    overflow: hidden; 
    position: fixed; 
    width: 100%;
    height: 100%;
}

.fullscreen-image-overlay img {
    touch-action: pinch-zoom;
}

@supports (-webkit-touch-callout: none) {
    body {
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
    }
    
    .screen {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }
}


.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #FF3B30;
    font-size: 16px;
    grid-column: 1 / -1;  
}


.auth-error-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.auth-error-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 320px;
    padding: 24px;
    animation: modalSlideUp 0.3s ease;
}

.auth-error-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 59, 48, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 30px;
    color: #FF3B30;
}

.auth-error-content h3 {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auth-error-content p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.auth-error-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-error-btn {
    padding: 14px;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.auth-error-btn.primary {
    background: var(--primary);
    color: white;
}

.auth-error-btn.primary:hover {
    background: var(--primary-light);
}

.auth-error-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.auth-error-btn.secondary:hover {
    background: var(--border-color);
}

.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.confirm-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 320px;
    padding: 24px;
    animation: modalSlideUp 0.3s ease;
}

.confirm-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 59, 48, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 30px;
    color: #FF3B30;
}

.confirm-content h3 {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.confirm-content p {
    text-align: left;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.confirm-btn {
    padding: 14px;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.confirm-btn.danger {
    background: #FF3B30;
    color: white;
}

.confirm-btn.danger:hover {
    background: #d32f2f;
}

.confirm-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.confirm-btn.secondary:hover {
    background: var(--border-color);
}

.offline-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
}

.offline-content {
    max-width: 280px;
}

.offline-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #000;
    text-align: center;
}

.offline-content p {
    font-size: 15px;
    color: #8e8e93;
    margin-bottom: 24px;
    line-height: 1.5;
    text-align: left;
}

.offline-btn {
    background: #000;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    cursor: pointer;
}
