
@font-face {
    font-family: "SFMada";
    src: url("fonts/SFMada.otf") format("opentype");
    font-weight: 400;
}

@font-face {
    font-family: "SFMada";
    src: url("fonts/SFMada-Bold.otf") format("opentype");
    font-weight: 700;
}

:root {
    color-scheme: dark;
    --background: #080a08;
    --surface: #131713;
    --border: #2a302a;
    --text: #f4f5f2;
    --muted: #9aA59a;
    --accent: #a6d9bf;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(ellipse at 50% 0%, #142314, var(--background) 60%);
    color: var(--text);
    min-height: 100vh;
}

html[lang="ar"] body {
    font-family: "IBM Plex Sans Arabic", sans-serif;
    font-weight: 400;
}

html[lang="ar"] h1,
html[lang="ar"] h2 {
    font-weight: 700;
}

html[lang="ar"] button,
html[lang="ar"] .field label,
html[lang="ar"] .gender-field legend,
html[lang="ar"] .gender-card {
    font-weight: 600;
}

html[lang="ar"] .result {
    font-weight: 400;
}

html[lang="en"] body {
    font-family: Arial, sans-serif;
}

button,
input,
select {
    font: inherit;
}

.page {
    width: min(100% - 36px, 600px);
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    gap: 20px;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    direction: ltr;
}

.brand-logo {
    display: block;
    width: clamp(44px, 10vw, 58px);
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-name {
    font-family: Arial, sans-serif;
    font-size: 13px;
    letter-spacing: 3px;
    font-weight: 700;
}

.language-button {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: 30px;
    padding: 9px 18px;
    cursor: pointer;
    min-height: 44px;
    flex-shrink: 0;
    transition: border-color 0.2s, background-color 0.2s;
}

.language-button:hover {
    border-color: var(--accent);
    background: #ffffff05;
}

.language-button:focus-visible,
.submit-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.hero {
    text-align: center;
    padding: 72px 0 44px;
}

.eyebrow {
    color: var(--accent);
    font-size: 15px;
    letter-spacing: 1px;
}

.hero h1 {
    font-size: clamp(32px, 7vw, 50px);
    line-height: 1.5;
    margin: 18px 0;
    font-weight: 700;
    text-wrap: balance;
}

.title-highlight {
    color: var(--accent);
}

.hero p {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.8;
    max-width: 470px;
    margin: 0 auto;
}

.finder-card {
    background: var(--surface);
    border: 1px solid #303730;
    border-radius: 24px;
    padding: 36px;
    box-shadow: 0 24px 64px #00000035, inset 0 1px 0 #ffffff04;
}

.card-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.card-heading h2 {
    margin: 0;
    font-size: 26px;
}

.step-label {
    color: var(--accent);
    font-family: Arial, sans-serif;
    font-size: 12px;
    letter-spacing: 2px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.field label {
    font-size: 17px;
    font-weight: 700;
}

.field input,
.field select {
    width: 100%;
    background: #0c100c;
    color: var(--text);
    border: 1px solid #303830;
    border-radius: 12px;
    padding: 14px 16px;
    outline: none;
    min-height: 56px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px #a6d9bf14;
}

.field input::placeholder {
    color: #879287;
}

.gender-field {
    border: 0;
    padding: 0;
    margin: 0 0 24px;
    min-width: 0;
}

.gender-field legend {
    padding: 0;
    margin-bottom: 10px;
    font-size: 17px;
    font-weight: 700;
}

.gender-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.gender-option {
    position: relative;
}

.body-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.gender-card.body-card {
    padding-inline: 6px;
    font-size: clamp(14px, 3.5vw, 17px);
    text-align: center;
    overflow-wrap: anywhere;
}

.gender-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.gender-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 72px;
    padding: 14px 16px;
    border: 1px solid #333b33;
    border-radius: 12px;
    background: #0c100c;
    color: var(--text);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.gender-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols", Arial, sans-serif;
    font-size: 26px;
    font-weight: 400;
    line-height: 1;
    direction: ltr;
}

.gender-card svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gender-card:hover {
    border-color: var(--accent);
}

.gender-option input:checked + .gender-card {
    border-color: var(--accent);
    background: #192b21;
    color: var(--accent);
    box-shadow: inset 0 0 0 1px #a6d9bf30;
}

.gender-option input:focus-visible + .gender-card {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.submit-button {
    width: 100%;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: #071007;
    font-size: 21px;
    font-weight: 700;
    padding: 15px;
    cursor: pointer;
    min-height: 58px;
    box-shadow: 0 4px 16px #00000020;
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.submit-button:hover {
    background: #b9e5ce;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px #00000030;
}

.submit-button:active {
    background: #94c9ad;
    transform: translateY(0);
    box-shadow: 0 2px 8px #00000020;
}

.result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    margin: 24px 0 0;
    padding: 24px 20px;
    border: 1px solid #a6d9bf40;
    border-radius: 16px;
    background: #152019;
    box-shadow: inset 0 1px 0 #ffffff04;
}

.result-label {
    color: var(--muted);
    font-size: 15px;
    font-weight: 400;
}

.result-size {
    font-size: clamp(42px, 10vw, 56px);
    line-height: 1.25;
    font-weight: 700;
}

.result-warning {
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.7;
}

.result:empty {
    display: none;
}

.note {
    color: var(--muted);
    text-align: center;
    font-size: 14px;
    margin: 20px 0 0;
}

.footer {
    display: flex;
    justify-content: space-between;
    color: #788478;
    padding: 32px 0;
    font-family: Arial, sans-serif;
    font-size: 11px;
    letter-spacing: 2px;
}

@media (max-width: 480px) {
    .header {
        gap: 12px;
        padding: 20px 0;
    }

    .brand {
        gap: 10px;
    }

    .brand-name {
        font-size: 11px;
        letter-spacing: 1.5px;
    }

    .language-button {
        padding: 9px 14px;
    }

    .hero {
        padding: 45px 0 30px;
    }

    .finder-card {
        padding: 26px 22px;
    }

    .field-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .language-button,
    .field input,
    .field select,
    .gender-card,
    .submit-button {
        transition: none;
    }

    .submit-button:hover,
    .submit-button:active {
        transform: none;
    }
}
