/* ================================
   Dark Theme – Global
================================ */
:root {
    --primary: #38bdf8;          /* Azzurro acceso */
    --primary-soft: #0ea5e9;
    --accent: #facc15;           /* Giallo caldo */
    --bg: #020617;               /* Fondo generale (molto scuro) */
    --bg-elevated: #020617;
    --bg-card: #0f172a;          /* Card / box */
    --border-soft: #1e293b;
    --text: #e5e7eb;             /* Testo principale */
    --text-soft: #94a3b8;
    --text-muted: #64748b;
    --danger: #f97373;
    --success: #4ade80;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* ================================
   Links
================================ */
a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ================================
   Layout containers
================================ */
header {
    background: radial-gradient(circle at top left, #0f172a 0, #020617 45%, #000000 100%);
    color: #f9fafb;
    padding: 20px 20px 40px 20px;
    border-bottom: 1px solid #1e293b;
}

header .container,
header .top-bar,
header .title-wrap,
main,
footer .container {
    max-width: 1100px;
    margin: 0 auto;
}

/* ================================
   Language switcher (index + privacy)
================================ */
header .top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.lang-switch {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 999px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.lang-switch span.label {
    color: var(--text-soft);
}

.lang-switch a {
    color: #e5e7eb;
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 999px;
    opacity: 0.7;
    font-weight: 500;
}

.lang-switch a.active {
    background: rgba(56, 189, 248, 0.18);
    opacity: 1;
    color: #e0f2fe;
}

.lang-switch a:hover {
    background: rgba(15, 23, 42, 0.9);
}

/* ================================
   Header content (index)
================================ */
header .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 30px;
}

.hero-text {
    flex: 2;
    min-width: 260px;
}

.hero-text h1 {
    font-size: 2.4rem;
    margin: 0 0 10px 0;
    letter-spacing: 0.03em;
}

.hero-text h2 {
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0 0 18px 0;
    color: var(--text-soft);
}

.hero-text p {
    max-width: 720px;
    margin: 0 0 20px 0;
    color: var(--text-soft);
}

/* Bottoni nella hero */
.hero-actions a {
    display: inline-block;
    padding: 10px 20px;
    margin-right: 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: #e5e7eb;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

.hero-actions a.primary-btn {
    background: linear-gradient(135deg, var(--primary-soft), var(--primary));
    border-color: transparent;
    color: #0b1120;
    box-shadow: 0 10px 25px rgba(56, 189, 248, 0.35);
}

.hero-actions a.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(56, 189, 248, 0.45);
}

.hero-actions a.secondary-btn {
    background-color: rgba(15, 23, 42, 0.7);
}

.hero-actions a.secondary-btn:hover {
    background-color: rgba(15, 23, 42, 0.95);
}

/* ================================
   Main content (index + privacy)
================================ */
main {
    background-color: var(--bg-elevated);
    padding: 30px 20px 60px 20px;
}

section {
    margin-bottom: 40px;
}

section h3 {
    margin-top: 0;
    font-size: 1.6rem;
    border-left: 4px solid var(--primary-soft);
    padding-left: 10px;
    color: #f9fafb;
}

/* ================================
   Cards & grids
================================ */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.card {
    background: radial-gradient(circle at top left, #1f2937 0, #020617 70%);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.card h4 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.15rem;
    color: #f9fafb;
}

.card p {
    color: var(--text-soft);
    font-size: 0.95rem;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #f97316);
    color: #111827;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

/* ================================
   Contact form
================================ */
.form-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0;
    margin-bottom: 18px;
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 20px;
}

.contact-form .full-width {
    grid-column: 1 / -1;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    color: #e5e7eb;
    font-size: 0.92rem;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    background-color: #020617;
    color: #e5e7eb;
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-soft);
    background-color: #020617;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.5);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* CAPTCHA */
.captcha-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-code {
    padding: 8px 14px;
    border-radius: 8px;
    background: repeating-linear-gradient(
        -45deg,
        #020617,
        #020617 4px,
        #0f172a 4px,
        #0f172a 8px
    );
    border: 1px solid var(--border-soft);
    font-weight: 700;
    letter-spacing: 0.16em;
    font-family: "JetBrains Mono", "Courier New", monospace;
    color: #e5e7eb;
    font-size: 0.95rem;
}

.captcha-refresh {
    font-size: 0.8rem;
    color: var(--text-soft);
}

.captcha-refresh a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.captcha-refresh a:hover {
    text-decoration: underline;
}

/* Privacy checkbox */
.privacy-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-soft);
}

.privacy-check input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-soft);
}

/* Submit button */
button[type="submit"] {
    background: linear-gradient(135deg, var(--primary-soft), var(--primary));
    color: #020617;
    border: none;
    border-radius: 999px;
    padding: 10px 24px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
    box-shadow: 0 10px 25px rgba(56, 189, 248, 0.35);
}

button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(56, 189, 248, 0.45);
}

/* ================================
   Flash messages
================================ */
.message {
    margin-bottom: 15px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.message.error {
    background-color: rgba(220, 38, 38, 0.08);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.7);
}

.message.success {
    background-color: rgba(22, 163, 74, 0.12);
    color: #bbf7d0;
    border: 1px solid rgba(74, 222, 128, 0.7);
}

/* ================================
   Footer
================================ */
footer {
    background-color: #020617;
    color: var(--text-muted);
    padding: 20px;
    font-size: 0.85rem;
    border-top: 1px solid #1e293b;
}

footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
}

footer a {
    color: #e5e7eb;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ================================
   Privacy page specific
================================ */
header .title-wrap h1 {
    margin: 0;
    font-size: 1.9rem;
}

.back-link {
    font-size: 0.9rem;
    color: var(--text-soft);
}

.back-link:hover {
    color: var(--primary-soft);
    text-decoration: none;
}

/* ================================
   Responsive
================================ */
@media (max-width: 700px) {
    .contact-form {
        grid-template-columns: 1fr;
    }

    header .top-bar {
        justify-content: space-between;
    }

    footer .container {
        flex-direction: column;
        align-items: flex-start;
    }
}
