
/* === Mobile / touch polish (SEO+mobile audit 2026-10-31) === */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
a, button, .btn, .tab-btn, .menu-toggle, summary, [role="button"] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button, .btn, .menu-toggle, .tab-btn, .btn-nav-cta {
  user-select: none;
  -webkit-user-select: none;
}
a:active, button:active, .btn:active, .tab-btn:active, .menu-toggle:active, .btn-nav-cta:active {
  opacity: 0.85;
}

/* Sintra Flora Quiz - Earthy, enchanted design */

:root {
    --moss-green: #4a5d4a;
    --fern-green: #6b8e6b;
    --leaf-light: #8fa98f;
    --stone-gray: #7a7a72;
    --cream: #f5f2eb;
    --warm-white: #faf9f6;
    --bark-brown: #5c4d3d;
    --gold-accent: #c9a95c;
    --correct-green: #4a7c4a;
    --incorrect-red: #a65a5a;
    --shadow-soft: rgba(74, 93, 74, 0.15);
}

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

html {
    font-size: 16px;
}

body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--cream) 0%, var(--warm-white) 50%, #e8e4dc 100%);
    min-height: 100dvh;
    color: var(--bark-brown);
    line-height: 1.6;
}

/* Main Container */
.quiz-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    min-height: calc(100dvh - 120px);
    display: flex;
    flex-direction: column;
}

/* Screens */
.screen {
    display: none;
    flex: 1;
    animation: fadeIn 0.4s ease;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

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

/* Intro Screen */
#intro-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem 1rem;
}

.intro-content {
    background: var(--warm-white);
    padding: 3rem 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px var(--shadow-soft);
    border: 1px solid rgba(107, 142, 107, 0.2);
}

.leaf-decoration {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 4px var(--shadow-soft));
}

h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--moss-green);
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.subtitle {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--fern-green);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.intro-text {
    color: var(--stone-gray);
    max-width: 400px;
    margin: 0 auto 1rem;
    font-size: 1.05rem;
}

.intro-text.small {
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.9rem 2.5rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.btn.primary {
    background: linear-gradient(135deg, var(--moss-green), var(--fern-green));
    color: white;
    box-shadow: 0 4px 15px rgba(74, 93, 74, 0.3);
}@media (hover: hover) and (pointer: fine) {
.btn.primary:hover{
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 93, 74, 0.4);
}
}

.btn.secondary {
    background: var(--warm-white);
    color: var(--moss-green);
    border: 2px solid var(--fern-green);
}@media (hover: hover) and (pointer: fine) {
.btn.secondary:hover{
    background: var(--fern-green);
    color: white;
}
}

/* Progress Bar */
.progress-bar {
    height: 6px;
    background: rgba(107, 142, 107, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--fern-green), var(--gold-accent));
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}

.question-number {
    text-align: center;
    font-size: 0.9rem;
    color: var(--stone-gray);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Question Card */
.question-card {
    background: var(--warm-white);
    border-radius: 20px;
    overflow: visible;
    box-shadow: 0 8px 32px var(--shadow-soft);
    border: 1px solid rgba(107, 142, 107, 0.15);
}

.question-card .question-content {
    border-radius: 0 0 20px 20px;
    background: var(--warm-white);
}

.image-container {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: visible;
    padding: 12px;
    padding-bottom: 8px;
    background: linear-gradient(180deg, var(--cream) 0%, var(--warm-white) 100%);
    border-radius: 20px 20px 0 0;
}

/* Sintra Royal Frame - Pena/Regaleira inspired */
.image-container .image-frame {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    
    /* Layered border: outer stone, inner gold accent */
    border: 4px solid var(--stone-gray);
    border-image: linear-gradient(
        135deg,
        #8a8a7a 0%,
        #a09a8a 20%,
        #7a7a6a 40%,
        #9a9488 60%,
        #7a7a6a 80%,
        #8a8a7a 100%
    ) 1;
    box-shadow: 
        inset 0 0 0 2px var(--gold-accent),
        inset 0 0 0 4px rgba(107, 142, 107, 0.3),
        0 4px 20px rgba(74, 93, 74, 0.25),
        0 2px 8px rgba(92, 77, 61, 0.15);
    border-radius: 4px;
    background: linear-gradient(135deg, var(--moss-green), var(--fern-green));
    padding: 3px;
}

/* Inner content area with subtle moss texture */
.image-container .image-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(201, 169, 92, 0.4);
    border-radius: 2px;
    pointer-events: none;
    z-index: 2;
}

/* Corner ornaments - botanical flourish accents inspired by Pena Palace ironwork */
.image-container .image-frame::after {
    content: '';
    position: absolute;
    inset: -6px;
    pointer-events: none;
    z-index: 3;
    background: 
        /* Top-left corner - decorative flourish */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cdefs%3E%3ClinearGradient id='g1' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23d4b86a'/%3E%3Cstop offset='100%25' stop-color='%23a08040'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M2 2 C2 2 6 2 10 6 C8 5 5 4 2 4 Z' fill='url(%23g1)'/%3E%3Cpath d='M2 2 C2 2 2 6 6 10 C5 8 4 5 4 2 Z' fill='url(%23g1)'/%3E%3Cpath d='M6 6 C6 6 9 6 12 9 C10 8 8 7 6 7 Z' fill='%234a5d4a' fill-opacity='0.8'/%3E%3Cpath d='M6 6 C6 6 6 9 9 12 C8 10 7 8 7 6 Z' fill='%234a5d4a' fill-opacity='0.8'/%3E%3Ccircle cx='3' cy='3' r='2.5' fill='%23c9a95c' stroke='%239a8040' stroke-width='0.5'/%3E%3C/svg%3E") no-repeat top left,
        /* Top-right corner - decorative flourish */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cdefs%3E%3ClinearGradient id='g1' x1='100%25' y1='0%25' x2='0%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23d4b86a'/%3E%3Cstop offset='100%25' stop-color='%23a08040'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M30 2 C30 2 26 2 22 6 C24 5 27 4 30 4 Z' fill='url(%23g1)'/%3E%3Cpath d='M30 2 C30 2 30 6 26 10 C27 8 28 5 28 2 Z' fill='url(%23g1)'/%3E%3Cpath d='M26 6 C26 6 23 6 20 9 C22 8 24 7 26 7 Z' fill='%234a5d4a' fill-opacity='0.8'/%3E%3Cpath d='M26 6 C26 6 26 9 23 12 C24 10 25 8 25 6 Z' fill='%234a5d4a' fill-opacity='0.8'/%3E%3Ccircle cx='29' cy='3' r='2.5' fill='%23c9a95c' stroke='%239a8040' stroke-width='0.5'/%3E%3C/svg%3E") no-repeat top right,
        /* Bottom-left corner - decorative flourish */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cdefs%3E%3ClinearGradient id='g1' x1='0%25' y1='100%25' x2='100%25' y2='0%25'%3E%3Cstop offset='0%25' stop-color='%23d4b86a'/%3E%3Cstop offset='100%25' stop-color='%23a08040'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M2 30 C2 30 6 30 10 26 C8 27 5 28 2 28 Z' fill='url(%23g1)'/%3E%3Cpath d='M2 30 C2 30 2 26 6 22 C5 24 4 27 4 30 Z' fill='url(%23g1)'/%3E%3Cpath d='M6 26 C6 26 9 26 12 23 C10 24 8 25 6 25 Z' fill='%234a5d4a' fill-opacity='0.8'/%3E%3Cpath d='M6 26 C6 26 6 23 9 20 C8 22 7 24 7 26 Z' fill='%234a5d4a' fill-opacity='0.8'/%3E%3Ccircle cx='3' cy='29' r='2.5' fill='%23c9a95c' stroke='%239a8040' stroke-width='0.5'/%3E%3C/svg%3E") no-repeat bottom left,
        /* Bottom-right corner - decorative flourish */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cdefs%3E%3ClinearGradient id='g1' x1='100%25' y1='100%25' x2='0%25' y2='0%25'%3E%3Cstop offset='0%25' stop-color='%23d4b86a'/%3E%3Cstop offset='100%25' stop-color='%23a08040'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M30 30 C30 30 26 30 22 26 C24 27 27 28 30 28 Z' fill='url(%23g1)'/%3E%3Cpath d='M30 30 C30 30 30 26 26 22 C27 24 28 27 28 30 Z' fill='url(%23g1)'/%3E%3Cpath d='M26 26 C26 26 23 26 20 23 C22 24 24 25 26 25 Z' fill='%234a5d4a' fill-opacity='0.8'/%3E%3Cpath d='M26 26 C26 26 26 23 23 20 C24 22 25 24 25 26 Z' fill='%234a5d4a' fill-opacity='0.8'/%3E%3Ccircle cx='29' cy='29' r='2.5' fill='%23c9a95c' stroke='%239a8040' stroke-width='0.5'/%3E%3C/svg%3E") no-repeat bottom right;
    background-size: 32px 32px;
}

.image-container .image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
    border-radius: 2px;
}

.image-container .image-frame .image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(transparent, rgba(250, 249, 246, 0.85));
    border-radius: 0 0 2px 2px;
    z-index: 1;
}

.question-content {
    padding: 1.5rem;
}

.question-content h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--bark-brown);
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

/* Answers */
.answers {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.answer-btn {
    width: 100%;
    text-align: left;
    padding: 1rem 1.25rem;
    background: var(--cream);
    border: 2px solid transparent;
    border-radius: 12px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1rem;
    color: var(--bark-brown);
    cursor: pointer;
    transition: all 0.2s ease;
}@media (hover: hover) and (pointer: fine) {
.answer-btn:hover:not(:disabled){
    border-color: var(--fern-green);
    background: rgba(107, 142, 107, 0.1);
}
}

.answer-btn.selected {
    border-color: var(--fern-green);
    background: rgba(107, 142, 107, 0.15);
}

.answer-btn.correct {
    border-color: var(--correct-green);
    background: rgba(74, 124, 74, 0.2);
    color: var(--correct-green);
}

.answer-btn.incorrect {
    border-color: var(--incorrect-red);
    background: rgba(166, 90, 90, 0.15);
    color: var(--incorrect-red);
}

.answer-btn:disabled {
    cursor: default;
}

/* Feedback Panel */
.feedback-panel {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--warm-white);
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 16px var(--shadow-soft);
    animation: slideUp 0.3s ease;
}

.feedback-panel.hidden {
    display: none;
}

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

.feedback-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.feedback-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--bark-brown);
    margin-bottom: 0.75rem;
}

.fun-fact {
    font-size: 0.95rem;
    color: var(--stone-gray);
    font-style: italic;
    margin-bottom: 1.25rem;
    line-height: 1.5;
    padding: 0 0.5rem;
}

/* Results Screen */
#results-screen {
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

.results-content {
    background: var(--warm-white);
    padding: 2.5rem 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 32px var(--shadow-soft);
    max-width: 500px;
    width: 100%;
}

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--moss-green), var(--fern-green));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 6px 24px rgba(74, 93, 74, 0.3);
}

#score-number {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.score-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
}

#results-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    color: var(--moss-green);
    margin-bottom: 0.75rem;
}

.results-message {
    color: var(--stone-gray);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.takeaways {
    background: var(--cream);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: left;
    margin-bottom: 2rem;
    border-left: 4px solid var(--gold-accent);
}

.takeaways h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    color: var(--moss-green);
    margin-bottom: 0.75rem;
}

.takeaways ul {
    list-style: none;
}

.takeaways li {
    font-size: 0.95rem;
    color: var(--stone-gray);
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
    position: relative;
}

.takeaways li:before {
    content: "🌱";
    position: absolute;
    left: 0;
    font-size: 0.8rem;
}

.takeaways li:last-child {
    margin-bottom: 0;
}

.sources-link {
    margin-top: 1.25rem;
    font-size: 0.9rem;
}

.sources-link a {
    color: var(--fern-green);
    text-decoration: none;
}@media (hover: hover) and (pointer: fine) {
.sources-link a:hover{
    text-decoration: underline;
}
}

/* Footer */
.footer {
    text-align: center;
    padding: 1rem;
    color: var(--stone-gray);
    font-size: 0.8rem;
}

.footer a {
    color: var(--fern-green);
    text-decoration: none;
}@media (hover: hover) and (pointer: fine) {
.footer a:hover{
    text-decoration: underline;
}
}

/* Responsive */
@media (max-width: 480px) {
    h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.25rem;
    }
    
    .intro-content {
        padding: 2rem 1.5rem;
    }
    
    .image-container {
        height: 180px;
    }
    
    .image-container .image-frame {
        border-width: 3px;
        padding: 2px;
    }
    
    .image-container .image-frame::after {
        inset: -5px;
        background-size: 26px 26px;
    }
    
    .question-content h2 {
        font-size: 1.2rem;
    }
    
    .score-circle {
        width: 120px;
        height: 120px;
    }
    
    #score-number {
        font-size: 3rem;
    }
}

@media (min-width: 768px) {
    .quiz-container {
        padding: 2rem;
    }
    
    .image-container {
        height: 280px;
    }
    
    .image-container .image-frame {
        border-width: 5px;
        padding: 4px;
    }
    
    .image-container .image-frame::after {
        inset: -8px;
        background-size: 36px 36px;
    }
    
    .question-content {
        padding: 2rem;
    }
}

/* HCAI Header - Light branding bar */
.hcai-header {
    background: var(--warm-white);
    border-bottom: 1px solid rgba(107, 142, 107, 0.15);
    padding: 0.75rem 1rem;
}

.hcai-header-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.hcai-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--bark-brown);
    font-weight: 600;
    font-size: 0.95rem;
}

.hcai-logo img {
    border-radius: 6px;
}@media (hover: hover) and (pointer: fine) {
.hcai-logo:hover{
    color: var(--moss-green);
}
}

.hcai-tagline {
    flex: 1;
    min-width: 200px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--stone-gray);
    line-height: 1.4;
}

.hcai-pitch {
    display: block;
}

.hcai-location {
    display: block;
    font-size: 0.8rem;
    opacity: 0.8;
}

.hcai-cta {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--moss-green);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s ease;
}@media (hover: hover) and (pointer: fine) {
.hcai-cta:hover{
    background: var(--fern-green);
}
}

@media (max-width: 600px) {
    .hcai-header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .hcai-tagline {
        order: 3;
        width: 100%;
    }
    
    .hcai-logo {
        font-size: 0.9rem;
    }
    
    .hcai-pitch {
        display: inline;
    }
    
    .hcai-location {
        display: inline;
    }
    
    .hcai-location::before {
        content: " · ";
    }
}
