/* =============================================
   AgriGreenSkills - Shared public styles
   =============================================
   Keep this file for shared foundations used by several public pages.
   Page-specific rules live in home.css, lesson.css, pretest.css, and
   module-quiz.css.
*/

/* Design tokens ---------------------------------------------------------- */
:root {
    --nav-bg: rgba(244, 243, 240, 0.72);
    --nav-border: rgba(200, 200, 190, 0.45);
    --text-primary: #222;
    --text-secondary: #666;
    --accent: #ed6d6a;
    --accent-light: rgba(237, 109, 106, 0.08);
    --green: #3a9e6e;
    --green-light: #e8f5ed;
    --danger: #D74750;
    --surface-muted: #f9f9f6;
}

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

body {
    font-family: "Inter", sans-serif;
    color: var(--text-primary);
    background: #fff;
}

.inter {
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
}

.roboto-slab {
    font-family: "Roboto Slab", serif;
    font-optical-sizing: auto;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: "Roboto Slab", serif;
}

img {
    max-width: 100%;
}

a {
    text-decoration: none;
    color: var(--accent);
}

/* Visibility helpers ----------------------------------------------------- */
.is-hidden {
    display: none;
}

/* Shared layout ---------------------------------------------------------- */
.smallWidth {
    max-width: 1200px;
    margin: auto;
}

.hero-shell {
    position: relative;
    overflow: hidden;
}

.lesson-hero,
.pretest-hero,
.quiz-hero {
    display: flex;
    align-items: center;
    padding: 150px 40px 50px;
    gap: 32px;
    min-height: 620px;
    position: relative;
    overflow: hidden;
}

.lesson-hero {
    min-height: 680px;
    padding-bottom: 60px;
}

.lesson-hero-text,
.pretest-hero-text,
.quiz-hero-text {
    max-width: 470px;
    position: relative;
    z-index: 2;
}

.lesson-hero-text {
    max-width: 480px;
}

.lesson-module-tag,
.pretest-tag,
.quiz-tag,
.result-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    background: var(--green-light);
    color: var(--green);
    border-radius: 20px;
    padding: 4px 14px;
    margin-bottom: 18px;
    letter-spacing: 0.03em;
}

.lesson-hero-text h1,
.pretest-hero-text h1,
.quiz-hero-text h1 {
    font-size: 38px;
    font-weight: normal;
    line-height: 1.15;
    color: #505050;
    margin-bottom: 24px;
}

.lesson-hero-text h1 {
    font-size: 44px;
    line-height: 1.12;
    margin-bottom: 10px;
}

.lesson-step-title {
    color: #505050;
    font-family: "Roboto Slab", serif;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.25;
    margin-bottom: 18px;
}

.lesson-hero-text .lesson-desc,
.pretest-hero-text p,
.quiz-hero-text p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
}

.lesson-hero-text .lesson-desc {
    margin-bottom: 32px;
}

.lesson-hero-img,
.pretest-hero-img,
.quiz-hero-img {
    position: absolute;
    top: 10px;
    right: calc((100vw - 1200px) / 2);
    width: 35%;
    bottom: 0;
    border-radius: 35px;
    overflow: hidden;
    margin-bottom: 30px;
}

.lesson-hero-img img,
.pretest-hero-img img,
.quiz-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Animation delays ------------------------------------------------------- */
.anim-delay-0 { transition-delay: 0s; }
.anim-delay-1 { transition-delay: .1s; }
.anim-delay-2 { transition-delay: .2s; }
.anim-delay-3 { transition-delay: .3s; }

/* Module theme helpers --------------------------------------------------- */
.card-badge.module-theme-1,
.module-theme-1 {
    background: #e8f5ed;
    color: #3a9e6e;
}

.card-badge.module-theme-2,
.module-theme-2 {
    background: #fff3e0;
    color: #e85d3a;
}

.card-badge.module-theme-3,
.module-theme-3 {
    background: #e8eaff;
    color: #5b5fe8;
}

/* Shared navigation ------------------------------------------------------ */
.iconUser {
    font-weight: 900;
    font-size: 20px;
    vertical-align: middle;
    margin-right: 7px;
}

.navbar-wrapper {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 1200px;
    z-index: 1000;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    height: 62px;
    background: var(--nav-bg);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid var(--nav-border);
    border-radius: 35px;
    box-shadow:
        0 2px 8px rgba(79, 110, 247, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-text {
    font-family: 'Clash Display', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--text-primary);
    letter-spacing: 0;
}

.logo-text span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--green);
    background: var(--green-light);
    border-color: rgba(58, 158, 110, 0.22);
    box-shadow: 0 3px 10px rgba(58, 158, 110, 0.12);
}

.nav-links a.active {
    color: #fff;
    background: var(--green);
    border-color: var(--green);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(58, 158, 110, 0.22);
}

.nav-links a svg {
    width: 15px;
    height: 15px;
    opacity: 0.6;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.nav-links a:hover svg,
.nav-links a.active svg {
    opacity: 1;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.nav-auth-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #828282;
    padding: 5px 15px;
    border-radius: 30px;
}

.nav-auth-actions:empty {
    display: none;
}

.language-form {
    display: flex;
    align-items: center;
}

.language-form select {
    appearance: none;
    border: 1px solid #828282;
    border-radius: 30px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    min-height: 42px;
    padding: 8px 30px 8px 14px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.language-form {
    position: relative;
}

.language-form::after {
    content: "\f078";
    color: var(--text-secondary);
    font-family: "Font Awesome 6 Free";
    font-size: 10px;
    font-weight: 900;
    pointer-events: none;
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    transition: color 0.2s ease;
}

.language-form:hover select {
    background: var(--green-light);
    border-color: rgba(58, 158, 110, 0.35);
    color: var(--green);
    box-shadow: 0 3px 10px rgba(58, 158, 110, 0.12);
}

.language-form:hover::after {
    color: var(--green);
}

.language-form select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(58, 158, 110, 0.16);
    outline: none;
}

.btn-login,
.btn-signup {
    padding: 9px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: var(--accent);
    background: none;
    transition: background 0.2s, transform 0.15s;
}

.btn-login:hover,
.btn-signup:hover {
    transform: translateY(-1px);
}

/* Shared buttons --------------------------------------------------------- */
.btn-back,
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1.5px solid #ccc;
    color: #555;
    border-radius: 20px;
    padding: 9px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition:
        border-color 0.2s,
        color 0.2s,
        transform 0.15s;
}

.btn-back:hover,
.btn-outline:hover {
    border-color: var(--green);
    color: var(--green);
    transform: translateY(-1px);
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1.5px solid #2a602b;
    color: #2a662d;
    border-radius: 20px;
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.2s,
        color 0.2s,
        transform 0.15s;
}

.btn-submit:hover {
    background: #61b88f;
    color: #fff;
    transform: translateY(-1px);
}

/* Shared assessment forms ------------------------------------------------ */
.pretest-form-section,
.quiz-form-section {
    padding: 20px 40px 70px;
    background: #fff;
}

.pretest-form,
.quiz-form {
    border: 1px solid #eee;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.form-heading {
    padding: 24px 28px;
    border-bottom: 1px solid #eee;
    background: var(--surface-muted);
}

.form-heading h2 {
    font-size: 30px;
    font-weight: normal;
    color: #505050;
    margin-bottom: 8px;
}

.form-heading p {
    max-width: 680px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.question-module {
    border-bottom: 1px solid #f0f0f0;
}

.question-module:last-of-type {
    border-bottom: none;
}

.question-module-heading {
    padding: 20px 28px 10px;
    background: #fff;
}

.question-module-heading h3 {
    font-size: 22px;
    font-weight: normal;
    color: #505050;
    margin-top: 8px;
}

.question {
    padding: 22px 28px;
    border-bottom: 1px solid #f0f0f0;
}

.question:last-of-type {
    border-bottom: none;
}

.question-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.question-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--green-light);
    color: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
}

.question h3 {
    font-size: 18px;
    line-height: 1.45;
    color: #1a1a1a;
}

.answers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.answers label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    border: 1.5px solid #ddd;
    border-radius: 16px;
    cursor: pointer;
    color: #555;
    font-size: 13px;
    line-height: 1.5;
    transition:
        border-color 0.2s,
        background 0.2s,
        color 0.2s;
}

.answers label:hover,
.answers label:focus-within {
    border-color: var(--green);
    background: var(--surface-muted);
    color: var(--text-primary);
}

.answers input {
    margin-top: 3px;
    accent-color: var(--green);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    padding: 24px 28px 28px;
    background: #fff;
}

/* Shared footer ---------------------------------------------------------- */
footer {
    padding: 32px 40px;
    background: #f7f5f0;
    border-top: 1px solid #eee;
}

.eu-badge {
    display: flex;
    align-items: baseline;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.erasmusFlag {
    height: 65px;
    width: auto;
    flex-shrink: 0;
}

.eu-badge-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#erasmusText {
    font-size: 11px;
    color: #666;
    line-height: 1.6;
    max-width: 700px;
}

.project-number {
    font-size: 11px;
    font-weight: 700;
    color: #444;
    margin-top: 4px;
}

.footer-bottom {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.creative-commons-logo {
    width: 88px;
    height: auto;
    flex-shrink: 0;
}

.footer-credit {
    font-size: 13px;
    color: #7b7b7b;
    text-align: right;
}

/* Shared responsive behavior ------------------------------------------- */
@media (max-width: 1100px) {
    .lesson-hero-img,
    .pretest-hero-img,
    .quiz-hero-img {
        right: 24px;
        width: 38%;
    }
}

@media (max-width: 820px) {
    .lesson-hero,
    .pretest-hero,
    .quiz-hero {
        display: block;
        padding: 110px 24px 28px;
        min-height: auto;
    }

    .lesson-hero-text,
    .pretest-hero-text,
    .quiz-hero-text {
        max-width: none;
    }

    .lesson-hero-img,
    .pretest-hero-img,
    .quiz-hero-img {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        height: 260px;
        margin: 34px 0 0;
        border-radius: 24px;
    }

    .pretest-form-section,
    .quiz-form-section {
        padding: 20px 24px 50px;
    }

    .answers {
        grid-template-columns: 1fr;
    }

    .form-heading,
    .question,
    .form-actions {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 768px) {
    .navbar-wrapper {
        width: calc(100% - 24px);
        top: 10px;
    }

    nav {
        padding: 0 18px;
    }

    .nav-links {
        display: none;
    }

    .nav-auth-actions span {
        display: none;
    }
}
