/* Basic reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f4f4f7;
    color: #111827;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* App shell */

.app-shell {
    width: 100%;
    max-width: 480px;
    margin: 1rem;
}

.app-header {
    text-align: center;
    margin-bottom: 0.75rem;
}

.app-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.subtitle {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Screens */

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.card {
    background: #ffffff;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.card.centered {
    text-align: center;
}

.card h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.card p {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.card ul {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.card li {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.consent-text {
    font-size: 0.85rem;
    color: #4b5563;
    margin-top: 0.35rem;
}

/* Buttons */

button {
    border: none;
    outline: none;
    cursor: pointer;
}

.primary-btn,
.secondary-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 999px;
    padding: 0.65rem 1.3rem;
    font-size: 0.95rem;
    font-weight: 600;
}

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

.primary-btn:active {
    transform: translateY(1px);
}

.secondary-btn {
    background: #e5e7eb;
    color: #374151;
}

.secondary-btn:active {
    transform: translateY(1px);
}

/* Status bar in task screen */

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

#task-instructions {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

/* Tap area */

#tap-area {
    position: relative;
    width: 100%;
    height: 320px;
    max-height: 60vh;
    border-radius: 0.75rem;
    background: #f9fafb;
    border: 1px dashed #e5e7eb;
    overflow: hidden;
    touch-action: none;
    /* important for pointer/touch handling */
}

/* Target button */

#tap-target {
    position: absolute;
    min-width: 72px;
    min-height: 72px;
    border-radius: 999px;
    background: #10b981;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.35);
    touch-action: none;
}

/* Footer bar */

.footer-bar {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #6b7280;
}

/* Survey */

.field {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.75rem;
}

.field span {
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.field select {
    padding: 0.4rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    font-size: 0.9rem;
}

.survey-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Misc */

.small {
    font-size: 0.85rem;
    color: #6b7280;
}

/* Mobile tweaks */

@media (max-width: 400px) {
    #tap-area {
        height: 260px;
    }
}

.lang-switch {
    margin-top: 0.5rem;
    display: inline-flex;
    gap: 0.25rem;
}

.lang-btn {
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    padding: 0.55rem 3rem;
    font-size: 1rem;
}

.lang-btn-active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

#tap-target {
    outline: none;
    -webkit-tap-highlight-color: transparent;
    /* removes grey/blue tap flash on mobile */
    -webkit-touch-callout: none;
    /* no iOS callout menu */
    user-select: none;
    /* no text selection highlight */
}

#tap-target:focus,
#tap-target:active {
    outline: none;
    box-shadow: none;
    /* if you see any leftover glow, this kills it */
}
