:root {
    --primary-color: #6C63FF;
    /* Przyjazny fiolet */
    --primary-hover: #5a52d5;
    --background-bg: #F3F5F9;
    --card-bg: #FFFFFF;
    --text-main: #2D3436;
    --text-muted: #636E72;
    --accent-boy: #74b9ff;
    --accent-girl: #ff7675;
    --border-radius: 16px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background-bg);
    color: var(--text-main);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.back-button {
    display: inline-block;
    padding: 10px 20px;
    margin-bottom: 20px;
    background-color: var(--card-bg);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid var(--primary-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.back-button:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

header {
    text-align: center;
    margin-bottom: 40px;
    margin-top: 20px;
}

header h1 {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-muted);
}

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

@media (min-width: 768px) {
    .grid {
        grid-template-columns: 350px 1fr;
        align-items: start;
    }
}

.card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

h2 {
    margin-bottom: 20px;
    font-size: 1.4rem;
    color: var(--text-main);
    border-bottom: 2px solid var(--background-bg);
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main);
}

input[type="number"],
input[type="date"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dfe6e9;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

input[type="number"]:focus,
input[type="date"]:focus {
    border-color: var(--primary-color);
    outline: none;
}

.hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* Age Input Tabs */
.age-input-container {
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    background: #f1f2f6;
    padding: 4px;
    border-radius: 12px;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.2s;
}

.tab.active {
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.manual-age-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Radio buttons custom styling */
.radio-group {
    display: flex;
    gap: 15px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 400;
}

.radio-label input {
    display: none;
}

.custom-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #dfe6e9;
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s;
}

.radio-label input:checked+.custom-radio {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.radio-label input:checked+.custom-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* Buttons */
button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    margin-bottom: 10px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background-color: #dfe6e9;
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #b2bec3;
}

/* Results */
.results-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.result-box {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}

.result-box h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.percentile-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Footer */
.main-footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.main-footer strong {
    color: var(--primary-color);
}