@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-start: #faf8f3;
    --bg-end: #f0ece3;
    --card-bg: #ffffff;
    --card-bg-alt: #fffef9;
    --text-main: #2d2a26;
    --text-muted: #7a756d;
    --accent: #f5d547;
    --accent-hover: #ebc924;
    --accent-light: #fdf6d0;
    --accent-border: #f5e27a;
    --success: #4caf50;
    --success-bg: #e8f5e9;
    --success-border: #a5d6a7;
    --warning: #fb8c00;
    --warning-bg: #fff8e1;
    --warning-border: #ffe082;
    --danger: #e53935;
    --danger-bg: #fce4ec;
    --danger-border: #ef9a9a;
    --border: #e8e4db;
    --border-light: #f0ece3;
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 2px 12px rgba(45, 42, 38, 0.06);
    --shadow-lg: 0 8px 30px rgba(45, 42, 38, 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    /* background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%); */ /* Отключение заливки фона */
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Container === */
.gc-container {
    max-width: 1060px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

/* === Header === */
.gc-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.gc-logo {
    max-width: 240px; /* Slightly smaller for better balance */
    margin: 1rem auto 2.5rem; /* Increased top and bottom margin */
}

.gc-logo svg {
    width: 100%;
    height: auto;
    display: block;
}

.gc-header h1 {
    font-size: 1.85rem; /* More balanced size */
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.gc-header-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 620px;
    margin: 0 auto;
    font-weight: 500;
    line-height: 1.5;
    opacity: 0.9;
    letter-spacing: -0.01em;
}

/* === Layout === */
.gc-main {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.gc-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.gc-inputs {
    flex: 1.4;
}

.gc-results {
    flex: 1;
    position: sticky;
    top: 1.5rem;
}

/* === Cards === */
.gc-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.25s ease;
}

.gc-card:hover {
    box-shadow: var(--shadow-lg);
}

.gc-card h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
}

.gc-card h2 .gc-section-icon {
    width: 24px;
    height: 24px;
    background: var(--accent-light);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gc-card h2 .gc-section-icon svg {
    width: 14px;
    height: 14px;
    color: #a68a00;
}

/* === Form Elements === */
.gc-form-group {
    margin-bottom: 1.25rem;
}

.gc-form-group > label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.gc-help-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    line-height: 1.5;
}

/* Custom Number Inputs */
input[type="number"] {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    background-color: var(--card-bg-alt);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

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

input[type="number"]:focus {
    border-color: #8c7300; /* Darker accent */
    background-color: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(245, 213, 71, 0.3), inset 0 2px 4px rgba(0,0,0,0.02);
}

input[type="number"]::placeholder {
    color: #aeb8c2;
    font-weight: 400;
}

/* === Segmented Gender Control === */
.gc-segmented-control {
    position: relative;
    display: flex;
    background: var(--bg-end);
    border-radius: var(--radius-sm);
    padding: 3px;
    border: 1px solid var(--border);
}

.gc-segmented-control input[type="radio"] {
    display: none;
}

.gc-segmented-control > label {
    flex: 1;
    text-align: center;
    padding: 0.55rem 1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 2;
    transition: color 0.3s ease;
    color: var(--text-muted);
    border-radius: 10px;
}

.gc-segmented-control input[type="radio"]:checked + label {
    color: var(--text-main);
    font-weight: 800;
}

.gc-segmented-slider {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc(50% - 3px);
    background-color: var(--accent);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(245, 213, 71, 0.4);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}

input#gender-male:checked ~ .gc-segmented-slider,
input#steatosis-no:checked ~ .gc-segmented-slider {
    transform: translateX(100%);
}

.gc-segmented-slider.three-steps {
    width: calc(33.33% - 3px);
}

input#steatosis-yes:checked ~ .gc-segmented-slider.three-steps {
    transform: translateX(0%);
}
input#steatosis-no:checked ~ .gc-segmented-slider.three-steps {
    transform: translateX(100%);
}
input#steatosis-unknown:checked ~ .gc-segmented-slider.three-steps {
    transform: translateX(200%);
}

.small-labels label {
    font-size: 0.82rem;
    padding: 0.45rem 0.5rem;
}

/* === Checkbox List === */
.gc-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gc-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-main);
    line-height: 1.4;
    padding: 0.25rem 0;
}

.gc-checkbox-item input {
    display: none;
}

.gc-checkbox-box {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
}

.gc-checkbox-item:hover .gc-checkbox-box {
    border-color: var(--accent);
}

.gc-checkbox-item input:checked + .gc-checkbox-box {
    background: var(--accent);
    border-color: var(--accent-hover);
}

.gc-checkbox-box:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #5a4800;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.gc-checkbox-item input:checked + .gc-checkbox-box:after {
    display: block;
}

.gc-card-intro {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* === Drink Items === */
.gc-drink-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s;
}

.gc-drink-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.gc-drink-item:first-child {
    padding-top: 0;
}

.gc-drink-icon {
    width: 56px;
    height: 56px;
    background: var(--accent-light);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gc-drink-icon svg {
    width: 32px;
    height: 32px;
}

.gc-drink-info {
    flex: 1;
    min-width: 0;
}

.gc-drink-name {
    font-weight: 600;
    font-size: 0.93rem;
    display: block;
    color: var(--text-main);
}

.gc-drink-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* === Counter Buttons === */
.gc-counter {
    display: flex;
    align-items: center;
    background: var(--bg-end);
    border-radius: 10px;
    border: 1px solid var(--border);
    overflow: hidden;
    flex-shrink: 0;
}

.gc-counter-btn {
    background: transparent;
    border: none;
    width: 34px;
    height: 34px;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gc-counter-btn:hover {
    background: var(--accent-light);
    color: var(--text-main);
}

.gc-counter-btn:active {
    background: var(--accent);
}

.gc-counter-val {
    width: 30px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
}

.gc-counter-val.has-value {
    color: #7a6800;
}

/* === Custom Drink Top === */
.gc-custom-drink.top-version {
    margin-top: 0;
    padding: 1rem;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent-border);
    margin-bottom: 1.5rem;
}

.gc-custom-drink h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #7a6800;
}

.gc-fib4-disclaimer.fib4-warning {
    background-color: #fff9db;
    border: 1px solid #ffe066;
    color: #856404;
    padding: 12px;
    border-radius: var(--radius-sm);
    opacity: 1;
    font-weight: 500;
}

.gc-bottle-btn {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.gc-bottle-btn:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.gc-bottle-btn:active {
    transform: translateY(1px);
}

/* === Results === */
.gc-result-card {
    text-align: center;
    background: var(--card-bg) !important;
}

.gc-result-card h2 {
    justify-content: center;
}

.gc-calc-summary {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gc-calc-highlight {
    background: var(--accent-light);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin: 0 -0.25rem;
    border: 1px dashed var(--accent-border);
}

.gc-calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gc-calc-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.gc-calc-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.gc-calc-sub-val {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.7;
    margin-left: 2px;
}

#total-value, #daily-value {
    font-variant-numeric: tabular-nums;
}

.gc-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 1.75rem;
}

.gc-verdict {
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    transition: all 0.35s ease;
    border: 1px solid transparent;
    text-align: left;
}

.gc-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

#verdict-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text-main);
}

#verdict-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* === Status colors === */
.status-low {
    background-color: var(--success-bg) !important;
    border-color: var(--success-border) !important;
}
.status-low .gc-badge {
    background-color: #c8e6c9;
    color: #1b5e20;
}
.status-low #total-value {
    color: #2e7d32;
}

.status-med {
    background-color: #fffde7 !important;
    border-color: #fff59d !important;
}
.status-med .gc-badge {
    background-color: #fff176;
    color: #f57f17;
}
.status-med #total-value {
    color: #f57f17;
}

.status-orange-1 {
    background-color: #fff8e1 !important;
    border-color: #ffcc80 !important;
}
.status-orange-1 .gc-badge {
    background-color: #ffe0b2;
    color: #e65100;
}
.status-orange-1 #total-value {
    color: #e65100;
}

.status-orange-2 {
    background-color: #fbe9e7 !important;
    border-color: #ffab91 !important;
}
.status-orange-2 .gc-badge {
    background-color: #ffccbc;
    color: #d84315;
}
.status-orange-2 #total-value {
    color: #d84315;
}

.status-high {
    background-color: var(--danger-bg) !important;
    border-color: var(--danger-border) !important;
}
.status-high .gc-badge {
    background-color: #ffcdd2;
    color: #b71c1c;
}
.status-high #total-value {
    color: #c62828;
}

/* === Disclaimer === */
.gc-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 1.25rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: left;
    background: var(--bg-start);
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    line-height: 1.5;
}

.gc-disclaimer svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--text-muted);
}

/* === Scale Bar === */
.gc-scale-bar {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.gc-scale-labels-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0 4px;
}

.gc-label-main {
    flex: 1;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
}

.gc-label-sub {
    flex: 1;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    opacity: 0.8;
}

.gc-scale-track {
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg, 
        #a5d6a7 0%, #a5d6a7 33%, 
        #ffe082 33%, #ffe082 50%, 
        #ffb74d 50%, #ffb74d 66%, 
        #ef9a9a 66%, #ef9a9a 100%
    );
    position: relative;
    margin: 1rem 0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.gc-scale-marker {
    position: absolute;
    top: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 4px solid var(--accent-main);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    transform: translateX(-50%);
    z-index: 5;
    transition: left 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gc-scale-threshold {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.6rem;
    font-weight: 800;
    color: rgba(0,0,0,0.4);
    pointer-events: none;
    white-space: nowrap;
}
.gc-scale-threshold.left { left: 33%; }
.gc-scale-threshold.right { left: 66%; }

.gc-scale-labels-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0 4px;
}

.gc-scale-labels span {
    width: 33%;
    text-align: center;
}

.gc-scale-labels span:first-child {
    width: auto;
    text-align: left;
}

/* === FIB-4 Section === */
.fib4-section {
    margin-top: 0.5rem;
    border: 1px solid var(--border);
}

.gc-fib4-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.gc-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.gc-fib4-result {
    background: var(--bg-start);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--border);
}

.gc-fib4-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0.5rem 0;
}

.gc-fib4-interpretation {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.4;
}

/* === Animations === */
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}
.pop-anim {
    animation: pop 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.gc-card {
    animation: fadeIn 0.4s ease forwards;
}

.gc-card:nth-child(2) { animation-delay: 0.1s; }
.gc-card:nth-child(3) { animation-delay: 0.2s; }

/* === Responsive === */
@media (max-width: 768px) {
    .gc-container {
        padding: 1rem 0.75rem 2rem;
    }

    .gc-logo {
        height: 36px;
    }

    .gc-header h1 {
        font-size: 1.35rem;
    }

    .gc-header p {
        font-size: 0.9rem;
    }

    .gc-main {
        flex-direction: column;
    }

    .gc-results {
        position: static;
    }

    .gc-card {
        padding: 1.15rem;
    }

    .gc-drink-icon {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

    .gc-drink-icon svg {
        width: 28px;
        height: 28px;
    }

    .gc-drink-name {
        font-size: 0.88rem;
    }

    .gc-counter-btn {
        width: 38px;
        height: 38px;
        font-size: 1.25rem;
    }

    .gc-counter-val {
        width: 28px;
        font-size: 1rem;
    }

    #total-value {
        font-size: 2.75rem;
    }

    .gc-custom-inputs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .gc-segmented-control > label {
        padding: 0.5rem 0.5rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 400px) {
    .gc-drink-item {
        gap: 0.5rem;
    }

    .gc-drink-icon {
        width: 42px;
        height: 42px;
    }

    .gc-drink-icon svg {
        width: 24px;
        height: 24px;
    }

    .gc-drink-name {
        font-size: 0.82rem;
    }

    .gc-drink-desc {
        font-size: 0.72rem;
    }
}

.gc-footer {
    margin-top: 3.5rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
    opacity: 0.75;
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
