:root {
    --brand-dark: #152234;
    --brand-light: #f5f7fa;
    --brand-border: #e0e6ed;
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --text-light: #9ca3af;
    --white: #ffffff;
    --danger: #ef4444;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-700: #374151;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --font-sans: "Roboto", sans-serif;
    --font-headings: "Fraunces", sans-serif;
}

* {
    box-sizing: border-box;
    font-family: var(--font-sans);
}

body {
    background-color: var(--brand-light);
    color: var(--text-main);
    font-family: var(--font-sans);
    margin: 0;
    padding: var(--spacing-md);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

@media (min-width: 640px) {
    body {
        align-items: center;
    }
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 60rem;
    margin: 0 auto;
    margin-top: var(--spacing-xl);
}

@media (min-width: 640px) {
    .container {
        margin-top: 0;
    }
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

@media (min-width: 640px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.pt-4 {
    padding-top: 1rem;
}

.pt-6 {
    padding-top: 1.5rem;
}

.pt-8 {
    padding-top: 2rem;
}

.w-full {
    width: 100%;
}

.font-Frau{
    font-family: "Fraunces", sans-serif;
}

.hidden {
 display: none !important;
}

.text-center {
    text-align: center;
}

.relative {
    position: relative;
}

/* Typography */
h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    font-family: var(--font-headings);
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-dark);
    margin: 0;
}

h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--brand-dark);
    margin: 0 0 0.75rem 0;
}

p {
    margin: 0;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-3xl {
    font-size: 1.875rem;
}

.text-4xl {
    font-size: 2.25rem;
}

.text-5xl {
    font-size: 3rem;
    /* background: red !important; */
    /* font-family: 'Fraunces'; */
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.text-brand-dark {
    color: var(--brand-dark);
}

.text-gray-600 {
    color: var(--text-muted);
}

.text-gray-700 {
    color: var(--gray-700);
}

.text-white {
    color: var(--white);
}

/* Components */
.card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(to right, var(--brand-dark), var(--brand-dark));
    padding: var(--spacing-xl);
    color: var(--white);
    text-align: center;
}

@media (max-width: 640px) {
    .card-header {
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }
}

.card-body {
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

@media (max-width: 640px) {
    .card-body {
        padding: 1.5rem;
    }
}

.section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.step-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 2rem;
    border-radius: 9999px;
    background-color: var(--brand-dark);
    color: var(--white);
    font-weight: 700;
    font-size: 1em;
    font-family: 'Fraunces';
    z-index: 2;
    outline: 3px solid white;
}

.section-header:before {
    content: "";
    width: 100%;
    height: 2px;
    background: #152234;
    position: absolute;
    top: 1rem;
    z-index: 1;
    border-radius: 50%;
}

.panel {
    background-color: var(--brand-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.info-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-top: 1rem;
}

.info-card p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.info-card strong {
    color: var(--brand-dark);
}

.result-card {
    /* background-color: var(--white); */
    background-image: linear-gradient(to bottom right, #eaeaea, #8ba8c9);
    /* border: 2px solid var(--brand-dark); */
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

.result-card-secondary {
    background: linear-gradient(to bottom right, #ffffff, #c0c0c0);
    /* border: 2px solid var(--gray-300); */
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

/* Forms */
.form-group {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.2s;
    outline: none;
    font-weight: 400;
}

.form-input:focus {
    border-color: var(--brand-dark);
}

.input-suffix {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Custom Select */
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23152234' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    background-color: var(--white);
}

/* Radio Buttons as Cards */
.radio-group {
    display: flex;
    gap: 0.5rem;
}

.radio-label {
    flex: 1;
    cursor: pointer;
}

.radio-input {
    display: none;
}

.radio-card {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--gray-300);
    text-align: center;
    font-weight: 500;
    transition: all 0.2s;
    min-width: 140px;
}

.radio-input:checked + .radio-card {
    border-color: var(--brand-dark);
    background-color: var(--brand-dark);
    color: var(--white);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, background-color 0.2s;
    border: none;
    font-size: 1rem;
    text-decoration: none;
}

.btn:hover {
    opacity: 0.9;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(to right, #152234, #8ca9ca);
    color: var(--white);
}

.btn-secondary {
    background-color: var(--gray-200);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--gray-300);
}

.btn-outline {
    background-color: var(--white);
    border: 2px solid var(--gray-300);
    color: var(--text-main);
    padding: 1rem;
}

.btn-outline:hover {
    border-color: var(--brand-dark);
}

.unit-toggle {
    display: inline-flex;
    border-radius: var(--radius-md);
    border: 2px solid var(--gray-300);
    padding: 0.25rem;
    gap: 3px;
}

.unit-btn {
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    border: none;
    background: #d2d6dc;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
}

.unit-btn.active {
    background-color: var(--brand-dark);
    color: var(--white);
}

.unit-btn:not(.active):hover {
    background-color: #d1d5db;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 15px;
    right: 15px;
    z-index: 50;
    background-color: var(--danger);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 400px;
}

.toast svg{
    width:20px;
    height:20px;
    min-width: 20px;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translate(-0%, -100%);
        opacity: 0;
    }

    to {
        transform: translate(-0%, 0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translate(0%, 0);
        opacity: 1;
    }

    to {
        transform: translate(0%, -100%);
        opacity: 0;
    }
}

.toast-enter {
    animation: slideIn 0.3s ease-out forwards;
}

.toast-exit {
    animation: slideOut 0.3s ease-in forwards;
}

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

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

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--brand-border);
    outline: none;
    cursor: pointer;
    background: linear-gradient(to right, var(--brand-dark) 0%, var(--brand-dark) var(--value), var(--brand-border) var(--value), var(--brand-border) 100%);
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand-dark);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(21, 34, 52, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand-dark);
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Footer */
.footer {
    background-color: var(--brand-light);
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--gray-200);
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Number Input Reset */
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}



/* --- Macro Strategy Card Styles --- */
.macro-strategy-btn {
    border: 2px solid var(--gray-200);
    background: var(--white);
    border-radius: 0.75rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    text-align: center;
}

.macro-strategy-btn:hover {
    border-color: var(--brand-light);
    background: var(--brand-light);
}

/* The Active State (Selected) */
.macro-strategy-btn.active {
    border-color: var(--brand-dark);
     /* Very light green/brand tint */
    box-shadow: 0 0 0 1px var(--brand-dark);
}

.macro-strategy-btn.active::after {
    content: '✓';
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--brand-dark);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}




.noUi-base,
.noUi-handle {
    transform: none !important;
    transition: 0s !important;
}

.noUi-horizontal {
    height: 5px;
    width: 100%;
}

.noUi-target {
    border: 0px;
    border-radius: 0 0 4px 4px;
    background: #d1dbd6;
    margin-top: -2px;
    cursor: pointer;
    /*box-shadow: 0 2px 0px 2px #0f1f3d;
    -webkit-box-shadow: 0px 6px 9px 3px rgba(0, 0, 0, 0.1);
    box-shadow: 0px 5px 15px 0px rgb(10 11 11 / 9%);*/
    box-shadow: none;
    margin-bottom: 6px;
}


.noUi-handle:after,
.noUi-handle:before {
    content: "";
    display: block;
    position: absolute;
    height: 6px;
    width: 0px;
    background: rgb(244 244 244 / 60%);
    left: 5px;
    top: 4px
}

.noUi-handle:after {
    left: 8px
}

.noUi-connect {
    box-shadow: none;
    background: linear-gradient(93deg, #4eaede, #152234);
    transition: 0s;
    border-radius: 0 0 4px 4px;
}

.noUi-handle {
    width: 16px !important;
    height: 16px !important;
    right: -12px !important;
    top: -6px !important;
    border: 2px solid #152234;
    border-radius: 50%;
    background-color: rgb(255, 255, 255);
    cursor: pointer;
    transform: scale(1);
    animation: pulse-white 2s infinite;
}

.noUi-pips {
    display: none;
}

@media (max-width: 640px) {
    #reset-btn {
        display: none;
    }
}


p.input-hint {
    font-size: 13px;
    color: #525252;
    margin-left: 4px;
    line-height: 1.2;
    margin-top: 5px;
}
