/* Tilim — визуальный стиль (зелёная палитра, скругления) + совместимость с Bootstrap */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(145deg, #f0f7ff 0%, #e9f0fa 100%);
    color: #111927;
    line-height: 1.5;
    min-height: 100vh;
    padding: 1.5rem 1rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-container {
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;

    backdrop-filter: blur(2px);
    border-radius: 3rem;
   
    padding: 1.8rem 2rem 2.5rem;
    transition: all 0.2s ease;
}

/* Кіру / тіркелу — ортада (көлденең және тік) */
.app-container.auth-page {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    margin-bottom: auto;
}

.auth-page .auth-card {
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 2rem;
    padding: 2rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 107, 76, 0.12);
}

.auth-page .auth-card form,
.auth-page .auth-card .alert {
    text-align: left;
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(0, 100, 80, 0.2);
    padding-bottom: 1rem;
    gap: 1rem;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #006b4c, #00997a);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
}

.logo p {
    font-size: 0.85rem;
    color: #2c6e5c;
    font-weight: 500;
    margin-top: 0.2rem;
}

.badge {
    background: #d9f0ec;
    padding: 0.4rem 1rem;
    border-radius: 60px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #006b4c;
}

/* Табы: Bootstrap nav-pills + фирменный вид */
.tilim-tabs {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 0.75rem;
}

.tilim-tabs .tab-btn {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.7rem 1.6rem;
    border-radius: 2rem;
    color: #3a5a50;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s;
}

.tilim-tabs .tab-btn i {
    font-size: 1.2rem;
}

.tilim-tabs .tab-btn:hover {
    background: #e5f3ef;
    color: #006b4c;
}

.tilim-tabs .tab-btn.active {
    background: #006b4c !important;
    color: #fff !important;
    box-shadow: 0 6px 12px rgba(0, 107, 76, 0.25);
}

.tab-pane {
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tilim-pill {
    background: #e0f0ea;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c6e5c;
}

.words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
    margin-top: 1rem;
}

.word-card {
    background: #fff;
    padding: 1.2rem;
    border-radius: 1.8rem;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.02), 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(0, 107, 76, 0.15);
}

.word-info h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2f2a;
}

.word-info p {
    color: #5f7c72;
    font-weight: 500;
}

.speak-btn {
    background: #eef3f1;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 42px;
    font-size: 1.3rem;
    color: #006b4c;
    cursor: pointer;
    transition: 0.2s;
}

.speak-btn:hover {
    background: #cfe8e0;
    transform: scale(1.02);
}

.speak-btn:focus-visible {
    outline: 2px solid #006b4c;
    outline-offset: 2px;
}

.speak-btn.is-speaking,
#speakCardBtn.is-speaking {
    background: #b9e6d7;
    color: #00543c;
    box-shadow: 0 0 0 3px rgba(0, 107, 76, 0.2);
    animation: tilimSpeakPulse 0.9s ease-in-out infinite;
}

@keyframes tilimSpeakPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.07);
    }
    100% {
        transform: scale(1);
    }
}

.flashcard-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 1rem 0 2rem;
}

.card-flip {
    background: #fff;
    width: 100%;
    max-width: 550px;
    min-height: 340px;
    border-radius: 2.5rem;
    box-shadow: 0 30px 40px -20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(0, 107, 76, 0.3);
    background: linear-gradient(145deg, #ffffff, #fefefe);
}

.card-flip:focus-visible {
    outline: 2px solid #006b4c;
    outline-offset: 4px;
}

.kazakh-word {
    font-size: 2.8rem;
    font-weight: 800;
    color: #006b4c;
    margin-bottom: 1rem;
    word-break: break-word;
}

.translation-hidden {
    font-size: 1.6rem;
    font-weight: 500;
    color: #426b5e;
    background: #eff9f5;
    padding: 0.5rem 1.5rem;
    border-radius: 60px;
    margin-top: 0.75rem;
}

.show-hint {
    margin-top: 1.2rem;
    font-size: 0.85rem;
    color: #00886a;
    background: #e9f3ef;
    padding: 0.3rem 1rem;
    border-radius: 60px;
}

.card-controls {
    display: flex;
    gap: 1.2rem;
    margin-top: 1.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

.ctrl-btn {
    background: #f0f4f2;
    border: none;
    padding: 0.7rem 1.4rem;
    border-radius: 3rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: 0.2s;
}

.ctrl-btn.primary {
    background: #006b4c;
    color: #fff;
}

.ctrl-btn:hover {
    filter: brightness(0.97);
}

.ctrl-btn:focus-visible {
    outline: 2px solid #006b4c;
    outline-offset: 2px;
}

.progress-indicator {
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 1rem;
    color: #2c6e5c;
}

.tilim-shuffle {
    background: #eff3f1;
}

.quiz-container {
    background: #fff;
    border-radius: 2rem;
    padding: 1.8rem;
    max-width: 700px;
    margin: 0 auto;
}

.quiz-question {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #1b3b32;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.quiz-option {
    background: #f8fbfa;
    border: 1px solid #cfe2db;
    padding: 1rem 1.2rem;
    border-radius: 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.1s;
}

.quiz-option:hover:not(.disabled) {
    background: #eef6f2;
    border-color: #00997a;
}

.quiz-option:focus-visible {
    outline: 2px solid #006b4c;
    outline-offset: 2px;
}

.quiz-option.correct {
    border-color: #00997a;
    background: #e6f5f0;
}

.quiz-option.wrong {
    border-color: #c94c4c;
    background: #fdecec;
}

.quiz-option.disabled {
    cursor: default;
    opacity: 0.85;
}

.quiz-feedback {
    margin-top: 1.2rem;
    text-align: center;
    font-weight: 600;
}

.quiz-result {
    text-align: center;
    padding: 1rem;
}

.restart-btn {
    background: #006b4c;
    border: none;
    color: #fff;
    padding: 0.8rem 1.8rem;
    border-radius: 3rem;
    font-weight: 700;
    margin-top: 1rem;
    cursor: pointer;
}

.restart-btn:hover {
    filter: brightness(1.05);
}

.restart-btn:focus-visible {
    outline: 2px solid #004d36;
    outline-offset: 2px;
}

footer {
    margin-top: 2.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: #6b8b7e;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 1.5rem;
}

/* Авторизация, хедер */
.tilim-hero-aside {
    align-items: flex-end;
}

.tilim-user-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: center;
}

.tilim-user-greet {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c6e5c;
    margin-right: 0.25rem;
}

a.tilim-user-link {
    text-decoration: none;
    font-size: 0.9rem;
}

a.tilim-user-link:hover {
    filter: brightness(0.95);
    color: inherit;
}

.tilim-flash-wrap {
    max-width: 1300px;
    width: 100%;
}

.tilim-auth-title {
    color: #1b3b32;
    font-weight: 700;
}

.tilim-btn-primary {
    background: #006b4c;
    color: #fff;
    border: none;
    border-radius: 3rem;
    font-weight: 700;
    padding: 0.65rem 1.25rem;
}

.tilim-btn-primary:hover {
    background: #005a40;
    color: #fff;
}

.tilim-link {
    color: #006b4c;
    font-weight: 600;
    text-decoration: none;
}

.tilim-link:hover {
    text-decoration: underline;
    color: #004832;
}

.tilim-input {
    border-radius: 1rem;
    border: 1px solid rgba(0, 107, 76, 0.25);
}

.tilim-input:focus {
    border-color: #006b4c;
    box-shadow: 0 0 0 0.2rem rgba(0, 107, 76, 0.15);
}

@media (max-width: 680px) {
    .app-container {
        padding: 1.2rem;
    }

    .hero {
        flex-direction: column;
        align-items: stretch;
    }

    .tilim-hero-aside {
        align-items: stretch;
    }

    .tilim-user-bar {
        justify-content: flex-start;
    }

    .kazakh-word {
        font-size: 2rem;
    }

    .tilim-tabs .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

button {
    font-family: inherit;
}

i,
button {
    user-select: none;
}
