@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600&display=swap');

:root {
    --background: oklch(1 0 0);
    --foreground: oklch(0.145 0 0);
    --card: oklch(1 0 0);
    --muted: oklch(0.97 0 0);
    --muted-foreground: oklch(0.556 0 0);
    --border: oklch(0.922 0 0);
    --ring: oklch(0.708 0 0);
    --destructive: oklch(0.577 0.245 27.325);

    --brand: oklch(0.75 0.15 122);
    --brand-foreground: oklch(0.145 0 0);
    --brand-border: oklch(0.55 0.15 122);
    --primary: var(--brand);
    --primary-foreground: var(--brand-foreground);

    --radius: 0.625rem;
    --radius-sm: calc(var(--radius) * 0.6);
    --radius-md: calc(var(--radius) * 0.8);
    --radius-lg: var(--radius);
    --radius-xl: calc(var(--radius) * 1.4);

    --font-sans: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
}

[data-theme="dark"] {
    --background: oklch(0.145 0 0);
    --foreground: oklch(0.985 0 0);
    --card: oklch(0.205 0 0);
    --muted: oklch(0.269 0 0);
    --muted-foreground: oklch(0.708 0 0);
    --border: oklch(1 0 0 / 10%);
    --ring: oklch(0.556 0 0);
    --destructive: oklch(0.704 0.191 22.216);

    --brand: oklch(0.75 0.15 122);
    --brand-foreground: oklch(0.145 0 0);
    --brand-border: oklch(0.85 0.13 122);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 16px;
    background-color: var(--background);
    color: var(--foreground);
}

/* App header controls (theme + language) */
.app-header {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

#lang-toggle {
    font-weight: 500;
    font-size: 0.75rem;
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--foreground);
    cursor: pointer;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
}

@media (hover: hover) and (pointer: fine) {
    .theme-toggle:hover {
        background: var(--muted);
    }
}

.theme-toggle:active {
    transform: translateY(1px);
}

.icon.hidden {
    display: none;
}

/* Header */
header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-bottom: 24px;
    text-align: center;
}

header p {
    letter-spacing: 0.5px;
    color: var(--foreground);
    font-size: 1.25rem;
    font-weight: 600;
}

/* Container */
.container {
    width: 100%;
    flex: 1;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Card */
.card {
    width: 430px;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px 40px 40px;
}

.container .form {
    display: flex;
    flex-direction: column;
}

/* Text-Boxes */
.form :where(.text-box, .title) {
    width: 100%;
    margin-top: 15px;
}

.text-box label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--foreground);
}

.form .text-box input {
    position: relative;
    height: 36px;
    width: 350px;
    font-size: 0.875rem;
    color: var(--foreground);
    margin-top: 5px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0 12px;
    background-color: var(--background);
    outline: none;
}

.form .text-box input:focus-visible {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent);
}

/* Gender */
.form .gender-box {
    margin-top: 15px;
}

.form .gender-box>label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--foreground);
}

.form :where(.gender-option, .gender) {
    display: flex;
    align-items: center;
    column-gap: 50px;
    flex-wrap: wrap;
}

.form .gender input[type="radio"] {
    display: none;
}

.form .gender label {
    position: relative;
    padding-left: 30px;
    margin-top: 5px;
    cursor: pointer;
    font-size: 0.875rem;
}

.form .gender label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background-color: var(--background);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.form .gender input[type="radio"]:checked+label::before {
    background-color: var(--brand);
    border-color: var(--brand-border);
}

/* Activities performed */
.form .activities-performed {
    max-width: 350px;
    margin-top: 15px;
}

.form .activities-performed>label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--foreground);
}

.form .activities-performed-items {
    max-width: 350px;
    margin: 0 auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
}

.form .activities-performed-items div {
    flex: 1 1 100px;
    max-width: 150px;
    box-sizing: border-box;
    flex-shrink: 0.5;
    margin-top: 5px;

}

.form .activities-performed-items div label {
    cursor: pointer;
}

.form .activities-performed-items div label {
    cursor: pointer;
    width: 100%;
}

.form .activities-performed-items div label input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: auto;
    width: 100%;
}

.form .activities-performed-items div label span {
    position: relative;
    display: inline-block;
    padding: 6px 20.5px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background-color: var(--background);
    color: var(--foreground);
    font-size: 0.875rem;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    width: 100%;
    text-align: center;

}

.form .activities-performed-items div label input[type="checkbox"]:checked~span {
    background-color: var(--brand);
    border-color: var(--brand-border);
    color: var(--brand-foreground);
}

.form .activities-performed-items div label span:active {
    transform: translateY(1px);
}

/* Goal */
.form .goals {
    margin-top: 15px;
}

.form .goals>label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--foreground);
}

.form .goal {
    position: relative;
    height: 36px;
    width: 350px;
    font-size: 0.875rem;
    color: var(--foreground);
    margin-top: 5px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0 10px;
    background-color: var(--background);
    text-align: left;
    cursor: pointer;
}

.form .goal:focus-visible {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent);
}

/* Calculate */
.form .calculate {
    color: var(--primary-foreground);
    background-color: var(--primary);
    position: relative;
    height: 36px;
    width: 350px;
    margin-top: 20px;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    padding: 0 10px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

.form .calculate:active {
    transform: translateY(1px);
}

/* Output box */
.form .output-box p {
    display: flex;
    align-items: center;
    position: relative;
    height: 100px;
    width: 350px;
    color: var(--foreground);
    margin-top: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 15px 10px;
    background-color: var(--background);
    text-align: left;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* Final text */
.form .final-text {
    margin-top: 15px;
    width: 350px;
    text-align: justify;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* Responsive */
@media screen and (max-width: 500px) {
    .form .column {
        flex-wrap: wrap;
    }

    .form :where(.gender-option, .gender) {
        row-gap: 15px;
    }

    .form :where(.text-box input, .goal, .calculate, .output-box p, .final-text) {
        width: 100%;
    }
}
