/* Mobile-first CSS for Quiz App */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #fafafa;
    color: #09090b;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e4e4e7;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #09090b;
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #18181b;
    font-size: 0.875rem;
}

.form-group input {
    padding: 0.625rem 0.875rem;
    border: 1px solid #d4d4d8;
    border-radius: 6px;
    font-size: 0.9375rem;
    background-color: white;
    transition: all 0.15s ease-in-out;
    color: #09090b;
}

.form-group input:hover {
    border-color: #a1a1aa;
}

.form-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.error {
    background-color: #fef2f2;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
    font-size: 0.875rem;
    border: 1px solid #fecaca;
}

.warning {
    background-color: #fffbeb;
    color: #d97706;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.875rem;
    border: 1px solid #fde68a;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #1d4ed8;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:disabled {
    background-color: #d4d4d8;
    color: #a1a1aa;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background-color: white;
    color: #09090b;
    border: 1px solid #e4e4e7;
}

.btn-secondary:hover {
    background-color: #fafafa;
    border-color: #d4d4d8;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-secondary:active {
    background-color: #f4f4f5;
}

/* Home Page */
.home-container {
    max-width: 600px;
    margin: 2rem auto;
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e4e4e7;
    text-align: center;
}

.home-container h1 {
    color: #09090b;
    margin-bottom: 1rem;
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.info {
    font-size: 1rem;
    color: #71717a;
    margin-bottom: 2rem;
    font-weight: 400;
}

.logout-form {
    margin-top: 1rem;
}

/* Question Page */
.question-container {
    max-width: 700px;
    margin: 1rem auto;
}

.progress {
    text-align: center;
    color: #71717a;
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.question-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e4e4e7;
}

.question-text {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: #09090b;
    line-height: 1.6;
    font-weight: 500;
}

.answer-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.answer-option {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    background-color: white;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.answer-option:hover {
    border-color: #2563eb;
    background-color: #eff6ff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.answer-option:has(input[type="radio"]:checked) {
    border-color: #2563eb;
    background-color: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.answer-option input[type="radio"] {
    margin-right: 0.875rem;
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    accent-color: #2563eb;
}

.answer-option label {
    flex: 1;
    cursor: pointer;
    font-size: 0.9375rem;
    color: #18181b;
    line-height: 1.5;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.button-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 2rem;
    justify-content: space-between;
}

.button-group .btn {
    flex: 1;
}

/* Results page button group - stack vertically and match card width */
.results-container .button-group {
    flex-direction: column;
    max-width: 100%;
}

.results-container .button-group .btn,
.results-container .button-group .logout-form {
    flex: none;
    width: 100%;
}

.results-container .button-group .logout-form button {
    width: 100%;
}

/* Results Page */
.results-container {
    max-width: 700px;
    margin: 1rem auto;
}

.results-container h1 {
    text-align: center;
    color: #09090b;
    margin-bottom: 2rem;
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.score-summary {
    margin-bottom: 2rem;
}

.score-box {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e4e4e7;
    text-align: center;
}

.score-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: #09090b;
    margin-bottom: 0.5rem;
    letter-spacing: -0.05em;
}

.score-percentage {
    font-size: 1.25rem;
    color: #71717a;
    font-weight: 500;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e4e4e7;
    border-left: 3px solid #d4d4d8;
    transition: all 0.15s ease-in-out;
}

.result-item:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.result-item.correct {
    border-left-color: #22c55e;
}

.result-item.incorrect {
    border-left-color: #ef4444;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.question-num {
    font-weight: 600;
    color: #09090b;
    font-size: 0.9375rem;
}

.result-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.025em;
}

.result-item.correct .result-badge {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.result-item.incorrect .result-badge {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.result-question {
    font-size: 1rem;
    margin-bottom: 1.25rem;
    color: #18181b;
    line-height: 1.6;
    font-weight: 500;
}

.result-answers {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.answer-row {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    padding: 0.5rem 0;
}

.answer-label {
    font-weight: 500;
    color: #71717a;
    min-width: 110px;
    font-size: 0.875rem;
}

.answer-value {
    flex: 1;
    color: #18181b;
    font-size: 0.9375rem;
}

.correct-answer {
    color: #22c55e;
    font-weight: 600;
}

/* Responsive adjustments for larger screens */
@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }

    .question-text {
        font-size: 1.5rem;
    }

    .answer-option {
        padding: 1.125rem 1.5rem;
    }

    .login-container,
    .home-container {
        padding: 3rem;
    }

    .question-card {
        padding: 2.5rem;
    }
}

