*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Open Sans', sans-serif;
    background: #F5FAF0;
    color: #1A1A1A;
    overflow: hidden;
}

p {
    margin-bottom: 0;
}

#quiz-app {
    max-width: 768px;
    margin: 0 auto;
    padding: 25px 0 50px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    --quiz-footer-height: 0px;
}

#quiz-app::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--quiz-footer-height);
    height: 140px;
    background: linear-gradient(to bottom, rgba(245, 250, 240, 0), #F5FAF0);
    pointer-events: none;
    opacity: 0;
    z-index: 2;
    transition: opacity 0.2s ease;
}

#quiz-app.has-main-scroll-gradient::after {
    opacity: 1;
}

/* Header */
.quiz-header {
    height: 72px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    width: 100%;
    max-width: 768px;
}

.quiz-header.has-shadow {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.quiz-header .logo img {
    height: 42px;
    display: block;
}

.quiz-header .phone {
    font-size: 15px;
    font-weight: 700;
    color: #1A1A1A;
}

/* Progress */
.progress-bar {
    height: 8px;
    background: #C1CFB0;
    width: 100%;
    max-width: 768px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #75B626;
    width: 0%;
    transition: width 0.4s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(-45deg,
            #000000 0px,
            #000000 4px,
            transparent 4px,
            transparent 8px);
    opacity: 0.18;
}

/* Step badge */
.step-badge {
    display: none;
    position: absolute;
    top: 121px;
    left: 24px;
    background: #fff;
    border-radius: 100px;
    padding: 4px 10px;
    font-size: 12px;
    color: #6E6E74;
    font-weight: 400;
    z-index: 5;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    max-width: 768px;
}

.step-badge.visible {
    display: inline-flex;
}

.step-badge b {
    color: #74B825;
    font-size: 20px;
    margin: 0 2px;
    font-weight: 700;
}

.step-badge .step-of {
    font-size: 14px;
    color: #6E6E74;
    font-weight: 400;
}

/* Main */
.quiz-main {
    flex: 1;
    padding: 24px 24px 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
    position: relative;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #aaaab0 transparent;
}

/* WebKit scrollbar */
.quiz-main::-webkit-scrollbar {
    width: 5px;
}

.quiz-main::-webkit-scrollbar-track {
    background: transparent;
}

.quiz-main::-webkit-scrollbar-thumb {
    background: #aaaab0;
    border-radius: 1000px;
}

/* Step visibility */
.step {
    display: none;
    flex-direction: column;
    flex: 1;
}

.step.active {
    display: flex;
}

/* Welcome */
.welcome-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.welcome-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.smiley-circle {
    width: 144px;
    height: 144px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    line-height: 1;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.welcome-title {
    font-size: 32px;
    font-weight: 700;
    color: #1A1A1A;
    max-width: 580px;
    margin: 0 0 12px;
    line-height: 40px;
}

.welcome-subtitle {
    font-size: 18px;
    color: #4C4C4C;
    margin: 0;
    line-height: 28px;
}

.welcome-hint {
    font-size: 18px;
    color: #999;
    margin: auto 0 24px;
    line-height: 28px;
}

/* Typography for steps */
.step-title {
    font-size: 32px;
    font-weight: 700;
    color: #1A1A1A;
    margin: 40px 24px 16px;
    text-align: center;
    line-height: 40px;
}

.step-subtitle {
    font-size: 18px;
    color: #4C4C4C;
    margin: 0 0 24px;
    text-align: center;
    line-height: 28px;
}

.step-hint {
    font-size: 18px;
    color: #999;
    text-align: center;
    margin-top: auto;
    padding: 16px 0;
    line-height: 28px;
}

/* Buttons */
.btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    line-height: 28px;
}

.btn:disabled {
    background: #F2F2F2 !important;
    color: #999 !important;
    border-color: #E6E6E6 !important;
    cursor: default;
    box-shadow: none !important;
}

.btn-primary {
    background: #75B626;
    color: #fff;
    box-shadow: 0 4px 14px rgba(117, 182, 38, 0.35);
}

.btn-primary:hover:not(:disabled) {
    background: #91C451;
}

.btn-primary:active:not(:disabled) {
    background: #ADCF7D;
}

.btn-secondary {
    background: #fff;
    color: #75B626;
    border: 1.5px solid #75B626;
}

.btn-secondary:hover:not(:disabled) {
    background: #EBF5D7;
}

.btn-secondary.active {
    background: #75B626;
    color: #fff;
}

.btn-secondary:active:not(:disabled) {
    background: #D6EAAE;
}

.btn-large {
    height: 72px;
    border-radius: 36px;
    font-size: 20px;
    width: 100%;
    max-width: 720px;
}

.btn-medium {
    height: 72px;
    border-radius: 36px;
    font-size: 20px;
    padding: 0 24px;
    flex: 1;
}

/* Card grids */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.card-grid.three-col {
    grid-template-columns: repeat(2, 1fr);
}

/* Generic card */
.card {
    background: #fff;
    border: 1.5px solid #D8E5C7;
    border-radius: 16px;
    padding: 16px 60px 16px 20px;
    min-height: 100px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
    line-height: 24px;
    position: relative;
}

.card:hover {
    border-color: #75B626;
}

.card.active {
    background: #EBF5D7;
    border-color: #75B626;
}

.card-radio {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid #D8E5C7;
    background: #fff;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.card.active .card-radio {
    background: #75B626;
    border-color: #75B626;
}

.card.active .card-radio::after {
    content: '\2713';
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.card .card-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.card .card-icon img {
    display: block;
    width: 40px;
    height: 40px;
}

/* Employee card */
.card.employee-card {
    flex-direction: column;
    padding: 20px 16px 16px;
    border-radius: 20px;
    min-height: 196px;
    text-align: center;
    justify-content: flex-start;
}

.card.employee-card .avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-size: 120%;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.card.employee-card .emp-name {
    font-size: 14px;
    font-weight: 600;
}

/* Rating grid */
.rating-grid {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin: 24px 0;
}

.rating-card {
    flex: 1;
    background: #fff;
    border: 1.5px solid #D8E5C7;
    border-radius: 20px;
    height: 148px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
    overflow: hidden;
}

.rating-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 20px 20px 0 0;
}

.rating-card[data-rating="1"]::before {
    background: #e53e3e;
}

.rating-card[data-rating="2"]::before {
    background: #f58a33;
}

.rating-card[data-rating="3"]::before {
    background: #f5c733;
}

.rating-card[data-rating="4"]::before {
    background: #75b626;
}

.rating-card[data-rating="5"]::before {
    background: #5a8c1c;
}

.rating-card:hover {
    border-color: #75B626;
}

.rating-card.active {
    background: #EBF5D7;
    border-color: #75B626;
}

.rating-emoji {
    font-size: 36px;
    line-height: 1;
    margin-bottom: 8px;
}

.rating-label {
    font-size: 14px;
    color: #4C4C4C;
    text-align: center;
    font-weight: 400;
    line-height: 16px;
}

.comment-field {
    margin-bottom: 24px;
}

.comment-field .input-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 8px;
}

.comment-box {
    background: #fff;
    border: 1.5px solid #D8E5C7;
    border-radius: 12px;
    padding: 16px;
    transition: border-color 0.15s;
}

.comment-box:focus-within {
    border-color: #75B626;
}

.comment-box .textarea {
    width: 100%;
    min-height: 120px;
    border: none;
    resize: none;
    font-family: inherit;
    font-size: 16px;
    color: #1A1A1A;
    outline: none;
    background: transparent;
    line-height: 1.5;
}

.comment-box .textarea::placeholder {
    color: #999;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* Option grid (reasons) */
.option-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 20px;
}

.option-row {
    background: #fff;
    border: 1.5px solid #D8E5C7;
    border-radius: 12px;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    cursor: pointer;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s;
}

.option-row:hover {
    border-color: #75B626;
}

.option-row.active {
    background: #EBF5D7;
    border-color: #75B626;
}

.option-row .checkbox {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid #D8E5C7;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.option-row.active .checkbox {
    background: #75B626;
    border-color: #75B626;
}

.option-row .checkbox::after {
    content: '\2713';
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.15s;
}

.option-row.active .checkbox::after {
    opacity: 1;
}

/* Form fields */
.form-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
    line-height: 24px;
}

.input {
    height: 56px;
    border-radius: 12px;
    border: 1.5px solid #D8E5C7;
    padding: 0 16px;
    font-family: inherit;
    font-size: 16px;
    color: #1A1A1A;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
    -webkit-appearance: none;
}

.input:focus {
    border-color: #75B626;
}

.input::placeholder {
    color: #999;
}

/* Button row */
.btn-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

/* Quiz footer */
.quiz-footer {
    width: 100%;
    max-width: 768px;
    background: transparent !important;
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 3;
}

.quiz-footer>* {
    z-index: 1;
}

/* Thank you */
.thanks-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-bottom: 48px;
}

.thanks-badge {
    width: 172px;
    height: 172px;
    margin-bottom: 24px;
}

.thanks-badge img {
    width: 100%;
    height: 100%;
    display: block;
}

.thanks-title {
    font-size: 36px;
    font-weight: 700;
    color: #1A1A1A;
    margin: 0 0 8px;
    line-height: 44px;
}

.thanks-subtitle {
    font-size: 20px;
    font-weight: 600;
    color: #4C4C4C;
    margin: 0 0 40px;
    line-height: 28px;
}

.thanks-countdown {
    font-size: 18px;
    color: #999;
    line-height: 28px;
}

/* Responsive */
@media (max-width: 600px) {
    .quiz-main {
        padding: 16px 16px 140px;
    }

    .card-grid,
    .option-grid {
        grid-template-columns: 1fr;
    }

    .card-grid.three-col {
        grid-template-columns: repeat(2, 1fr);
    }

    .rating-grid {
        gap: 6px;
    }

    .rating-card {
        height: 120px;
        border-radius: 16px;
    }

    .rating-emoji {
        font-size: 36px;
    }

    .welcome-title {
        font-size: 24px;
        line-height: 32px;
    }

    .step-title {
        font-size: 24px;
        line-height: 32px;
    }

    .btn-large {
        height: 64px;
        border-radius: 32px;
        font-size: 18px;
    }

    .btn-medium {
        height: 64px;
        border-radius: 32px;
        font-size: 18px;
    }

    .thanks-title {
        font-size: 28px;
        line-height: 36px;
    }
}

@media (max-width: 480px) {
    .card-grid.three-col {
        grid-template-columns: repeat(2, 1fr);
    }

    .btn-medium {
        font-size: 16px;
        padding: 0 16px;
    }
}

@media (max-width: 360px) {
    .card-grid.three-col {
        grid-template-columns: 1fr;
    }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #E53935;
    color: #fff;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 100;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
