/* Base styles – AMALTEA theme, after amaltea-project.eu */

/* ── Fonts ──────────────────────────────────────────────────────────────── */

/* Self-hosted so no visitor data goes to Google (SIL OFL, see fonts/OFL.txt). */
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/SpaceGrotesk-latin.woff2') format('woff2');
}

/* ── Design tokens ──────────────────────────────────────────────────────── */

:root {
    /* Brand palette, taken from the project website's global colors */
    --amaltea-blue:       #2B648F;
    --amaltea-navy:       #123055;
    --amaltea-ink:        #1A202C;
    --amaltea-green:      #99EA81;
    --amaltea-green-dark: #2B6B55;
    --amaltea-sky:        #99DFEA;
    --amaltea-steel:      #67A7C1;
    --amaltea-mist:       #D1F0F5;

    --primary:      var(--amaltea-blue);
    --primary-dark: var(--amaltea-navy);
    --accent:       var(--amaltea-green);
    --accent-dark:  var(--amaltea-green-dark);
    --error:        #b42318;
    --success:      var(--amaltea-green-dark);
    --warning:      #b26a00;
    --info:         var(--amaltea-blue);
    --text:         var(--amaltea-ink);
    --text-light:   #4A5568;
    --bg:           #F7FAFC;
    --bg-alt:       #EEF8FA;
    --border:       #D5E3EA;
    --shadow:       0 12px 32px -16px rgba(18, 48, 85, 0.28), 0 1px 3px rgba(18, 48, 85, 0.06);
    --radius:       6px;
    /* The site's signature leaf shape: two opposite corners rounded */
    --radius-leaf:  24px 0 24px 0;
    --radius-btn:   0 0 0 18px;
    --spacing:      1rem;
    --font:         'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                    Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */

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

/* ── Body ───────────────────────────────────────────────────────────────── */

html { height: 100%; }

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    background: var(--amaltea-mist) url('../img/website-bg.jpg') center top / cover fixed no-repeat;
    color: var(--text);
    line-height: 1.6;
}

/* ── Header: dark top bar + blue navigation bar ─────────────────────────── */

.topbar {
    background: var(--amaltea-ink);
    color: #F7FAFC;
    font-size: 0.85rem;
    font-weight: 600;
}

.topbar-inner,
.navbar-inner,
.hero-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: 2.5rem;
}

.topbar a { color: #F7FAFC; }
.topbar a:hover { color: var(--amaltea-green); text-decoration: none; }

.topbar-user {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-user {
    font-weight: 400;
    opacity: 0.85;
}

.navbar {
    background: var(--amaltea-blue);
    color: white;
    box-shadow: 0 2px 10px rgba(18, 48, 85, 0.25);
}

.navbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem 2rem;
    min-height: 5.5rem;
}

.brand {
    display: inline-flex;
    align-items: flex-end;
    gap: 0.6rem;
}

.brand:hover { text-decoration: none; opacity: 0.9; }

/* The project logos are full color; the site shows them solid white on blue. */
.brand img { filter: brightness(0) invert(1); display: block; }
.brand-icon     { height: 2.4rem; width: auto; }
.brand-wordmark { height: 1.9rem; width: auto; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links a {
    position: relative;
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 0.35rem 0;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--amaltea-green);
    transform: scaleX(0);
    transition: transform 0.2s;
}

.nav-links a:hover { text-decoration: none; }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--amaltea-sky); }
.nav-links a.active::after { background: var(--amaltea-sky); }

/* ── Hero banner ────────────────────────────────────────────────────────── */

.hero {
    background:
        linear-gradient(90deg, rgba(18, 48, 85, 0.55) 0%, rgba(43, 100, 143, 0.15) 70%),
        var(--amaltea-blue) url('../img/pic-bg.jpg') center / cover no-repeat;
    color: white;
    padding-block: 2.25rem;
}

.hero-eyebrow {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--amaltea-green);
    margin-bottom: 0.25rem;
}

.hero h1 {
    color: white;
    font-size: clamp(1.6rem, 3.5vw, 2.5rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0.02em;
    margin: 0;
}

/* ── Main layout ────────────────────────────────────────────────────────── */

main {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1440px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.site-footer {
    margin-top: 2rem;
}

.footer-main {
    background: rgba(255, 255, 255, 0.92);
    border-top: 4px solid var(--amaltea-blue);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem 3rem;
    padding: 2rem max(1.5rem, calc((100% - 1440px) / 2 + 1.5rem));
}

.footer-logo img {
    display: block;
    height: 4.5rem;
    width: auto;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
}

.footer-links a {
    color: var(--amaltea-blue);
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.footer-bottom {
    background: var(--amaltea-ink);
    color: #CBD5E0;
    font-size: 0.85rem;
    text-align: center;
    padding: 0.9rem 1.5rem;
}

/* ── Typography ─────────────────────────────────────────────────────────── */

h1, h2, h3, h4 {
    color: var(--amaltea-navy);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing);
}

h2 { font-size: 1.9rem; color: var(--amaltea-blue); letter-spacing: 0.01em; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

a { color: var(--amaltea-blue); text-decoration: none; }
a:hover { color: var(--amaltea-green-dark); text-decoration: underline; }
a.btn,
a.btn:hover { text-decoration: none; }

/* ── Card ───────────────────────────────────────────────────────────────── */

.card {
    background: white;
    border-radius: var(--radius-leaf);
    box-shadow: var(--shadow);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
}

.card h3 { margin-bottom: 1rem; }

/* ── Forms ──────────────────────────────────────────────────────────────── */

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="date"],
input[type="number"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 12px 0 0 0;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: var(--text);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--amaltea-blue);
    box-shadow: 0 0 0 3px rgba(153, 223, 234, 0.7);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: var(--amaltea-blue);
    color: white;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--radius-btn);
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.2;
    font-family: inherit;
}

.btn:hover         { background: var(--amaltea-green-dark); color: white; }
.btn:focus-visible { outline: 3px solid var(--amaltea-sky); outline-offset: 2px; }

.btn-accent        { background: var(--amaltea-green); color: var(--amaltea-green-dark); }
.btn-accent:hover  { background: var(--amaltea-green-dark); color: white; }
.btn-secondary     { background: white; color: var(--amaltea-blue); box-shadow: inset 0 0 0 1px var(--amaltea-blue); }
.btn-secondary:hover { background: var(--amaltea-mist); color: var(--amaltea-navy); }
.btn-danger        { background: var(--error); }
.btn-danger:hover  { background: #7a1a10; }
.btn-sm            { padding: 0.5rem 0.9rem; font-size: 0.75rem; border-radius: 0 0 0 12px; }

/* ── Badges ─────────────────────────────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-type    { background: var(--amaltea-mist); color: var(--info); }
.badge-success { background: #EAF8E4; color: var(--success); }
.badge-warning { background: #fff3e0; color: var(--warning); }
.badge-error   { background: #ffebee; color: var(--error); }

/* ── Alert banners ──────────────────────────────────────────────────────── */

.error,
.success,
.warning {
    padding: 1rem 1.25rem;
    border-radius: 0 16px 0 0;
    margin-bottom: 1.5rem;
    border-left: 4px solid currentColor;
    box-shadow: var(--shadow);
}

.error   { background: #fdecea; color: var(--error); }
.success { background: #EAF8E4; color: var(--success); border-left-color: var(--amaltea-green); }
.warning { background: #fff3e0; color: var(--warning); }

/* ── Tables ─────────────────────────────────────────────────────────────── */

table {
    width: 100%;
    margin-top: var(--spacing);
    border-collapse: collapse;
}

table tr  { border-bottom: 1px solid var(--border); }
table td  { padding: 0.75rem; }

table td:first-child {
    font-weight: 500;
    color: var(--text-light);
    width: 150px;
}

/* ── Utilities ──────────────────────────────────────────────────────────── */

.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; justify-content: center; align-items: center; }
.flex-gap     { display: flex; gap: var(--spacing); flex-wrap: wrap; align-items: center; }

.mt-1 { margin-top: var(--spacing); }
.mt-2 { margin-top: calc(var(--spacing) * 2); }
.mb-1 { margin-bottom: var(--spacing); }
.mb-2 { margin-bottom: calc(var(--spacing) * 2); }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-light  { color: var(--text-light); }
.text-muted  { color: #718096; }
.text-small  { font-size: 0.9rem; }

.disabled { opacity: 0.5; pointer-events: none; }

/* ── Shared layout helpers ──────────────────────────────────────────────── */

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: var(--spacing);
}

.header-actions > div:first-child { flex: 1; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing);
}

/* ── Login ──────────────────────────────────────────────────────────────── */

.login-card {
    max-width: 440px;
    margin: 2.5rem auto;
    padding: 2.5rem 2.25rem;
    border-radius: 36px 0 36px 0;
}

.login-logo {
    display: block;
    height: 5.5rem;
    width: auto;
    margin: 0 auto 0.75rem;
}

.login-app {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.login-form {
    display: grid;
    gap: 1rem;
}

.login-actions {
    margin-top: 0.5rem;
}

.login-actions .btn { width: 100%; }

/* ── Home page (/index) ─────────────────────────────────────────────────── */

.header-info-box {
    background: var(--bg-alt);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: right;
    border: 1px solid var(--border);
}

.header-info-box p { margin: 0.25rem 0; }

.level-indicators {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.level-item {
    padding: 1rem;
    background: var(--bg-alt);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
}

.level-item p { margin: 0.5rem 0 0; }

.progress-items { display: flex; flex-direction: column; gap: 1rem; }

.progress-item {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    align-items: flex-start;
    transition: opacity 0.2s;
}

.progress-item.complete {
    background: #EAF8E4;
    border-left: 4px solid var(--success);
}

.progress-item.incomplete { opacity: 0.5; }
.progress-item:hover { opacity: 1; }

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.progress-item.complete .step-number { background: var(--success); }
.progress-item div   { flex: 1; }
.progress-item strong{ display: block; margin-bottom: 0.25rem; }

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .topbar-inner,
    .navbar-inner,
    .hero-inner       { padding: 0 1rem; }
    .navbar-inner     {
        flex-direction: column;
        align-items: flex-start;
        padding-block: 1rem;
        min-height: 0;
    }
    .nav-links        {
        width: 100%;
        justify-content: flex-start;
        gap: 0.5rem 1.5rem;
    }
    .brand-icon       { height: 2rem; }
    .brand-wordmark   { height: 1.6rem; }
    .hero             { padding-block: 1.5rem; }
    main              { padding: 0 1rem; margin: 1.5rem auto; }
    .footer-main      { padding: 1.5rem 1rem; }
    .header-actions   { flex-direction: column; }
    .card-grid        { grid-template-columns: 1fr; }
    .card             { padding: 1.25rem; }
}
