* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary{
    display: block;
}
html{
    height: 100%;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 17px;
    min-height: 100vh;
    padding: 0;
    line-height: 1.6;
}
.header{
    padding: 20px;
    padding-bottom: 0;
}
.header img{
    display: block;
    margin: auto;
}
.container {
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: auto;
    background: #fff;
}

.calculator {
    padding: 20px 10px;
    order: 1;
}
.calculator h3{
    font-weight: 600;
    font-size: 24px;
    margin-bottom: 14px;
    text-align: center;
}
.about{
    order: 5;
    padding: 18px;
    font-size: 17px;
    background: rgba(250, 210, 0, .5);
    margin-bottom: 32px;
    border-radius: 15px;
}
.about-header{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}
.about-header span{
    display: block;
    padding: 4px 10px 4px 10px;
    background: #edd765;
    font-size: 15px;
    border-top-right-radius: 10px 10px;
}
.about h1 {
  font-weight: 600;
  font-size: 25px;
  line-height: 30px;
  margin-bottom: 18px;
}
.about p{
    margin-bottom: 14px;
}
.alcotester-description{
    order: 6;
    margin-bottom: 24px;
    padding: 10px;
}
.alcotester-description h2 {
    text-align: center;
    font-weight: 600;
    font-size: 25px;
    line-height: 30px;
    padding: 5px 0 5px 0px;
    margin-bottom: 14px;
}
.alcotester-description p{
    margin-bottom: 14px;
    font-size: 16px;
}
.more-par{
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 16px;
}
.note{
    order: 2;
    background: #FFAD15;
    padding: 18px 10px;
    margin-left: 10px;
    margin-right: 10px;
    font-size: 16px;
    line-height: 22px;
    border-radius: 10px;
    margin-bottom: 32px;
}
.note strong{
    font-weight: 600;
}
.kak-help{
    order: 3;
    margin-bottom: 32px;
    border-radius: 10px;
    padding: 20px 10px;
    padding-left: 0px;
    padding-left: 300px;
    background: url(https://alko-test.ru/assets/images/kak.jpg) left center no-repeat;
}
.kak-help p a {
    font-weight: 600;
    font-size: 22px;
    line-height: 28px;
    margin-bottom: 14px;
    padding: 10px 0 10px 0px;
    color: #b40000;
}
.kak-help p a:hover{
    text-decoration: none;
}
.friends{
    order: 4;
    text-align: center;
    order: 3;
    margin-bottom: 24px;
    background: #e5f0fc;
    padding: 18px 24px 24px 24px;
}
.friends-wrap{
    padding: 14px 0;
}
.friends h4{
    font-weight: 600;
    font-size: 22px;
    line-height: 28px;
    padding: 5px 0 5px 0px;
}   
.form-section {
    margin-bottom: 30px;
    background: white;
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.footer {
    padding: 20px 0 20px 0;
    background: #6a6a6a;
}
.footer-wrap {
    position: relative;
    max-width: 800px;
    margin: auto;
    padding: 0 10px 0 10px;
    text-align: center;
}
.copywrite {
    font-size: 15px;
    color: #fff;
}
/* Gender Selection */
.gender-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.gender-group.invalid {
    border: 2px solid #dc3545;
    border-radius: 12px;
    padding: 8px;
    background: rgba(220, 53, 69, 0.05);
}

.gender-option {
    position: relative;
}

.gender-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.gender-option label {
    display: block;
    padding: 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gender-option input[type="radio"]:checked + label {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: scale(1.02);
}

.error-message {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 8px;
    display: none;
}

/* Slider Controls */
.slider-group {
    margin-bottom: 25px;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 500;
    color: #333;
}

.slider-value {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 1.1em;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

.slider-container {
    position: relative;
    margin: 16px 0;
    padding: 10px 0; /* Добавляем отступы для удобства клика */
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    outline: none;
    position: relative;
    pointer-events: none; /* Отключаем клики по трекингу */
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 42px; /* Увеличили размер */
    height: 42px; /* Увеличили размер */
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
    pointer-events: auto; /* Включаем клики только для кружочка */
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.slider::-webkit-slider-thumb:active {
    transform: scale(1.2);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5);
}

.slider::-moz-range-thumb {
    width: 42px; /* Увеличили размер */
    height: 42px; /* Увеличили размер */
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    pointer-events: auto; /* Включаем клики только для кружочка */
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Убираем фокус при клике на трекинг */
.slider:focus {
    outline: none;
}

.slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    height: 8px;
    background: #667eea;
    border-radius: 4px;
    transform: translateY(-50%);
    transition: width 0.2s ease;
    pointer-events: none; /* Некликабельный трекинг */
}

/* Select Inputs */
.select-input {
    width: 100%;
    padding: 16px 16px 16px 8px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 56px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.select-input:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Drinks Section */
.drinks-section {
    background: #f8f9fa;
    border-radius: 16px;
    margin-bottom: 20px;
}

.drink-item {
    background: white;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.drink-item:last-child {
    margin-bottom: 16px;
}

.drink-controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
}

.drink-controls .slider-group {
    margin-bottom: 0;
}

.remove-btn {
    width: 48px;
    height: 48px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-btn:active {
    transform: scale(0.95);
    background: #c82333;
}

.add-drink-btn {
    width: 100%;
    padding: 16px;
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 56px;
}

.add-drink-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    color: #495057;
}

.add-drink-btn:active {
    transform: scale(0.98);
    background: #dee2e6;
    border-color: #ced4da;
}

/* Calculate Button */
.calculate-btn {
    width: 240px;
    margin: 20px auto 32px auto;
    display: block;
    padding: 18px 24px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.calculate-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(255, 107, 107, 0.5);
}

.calculate-btn:hover:before {
    left: 100%;
}

.calculate-btn:active {
    transform: translateY(0px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.6);
}

/* Results */
.results {
    display: none;
    background: white;
    border-radius: 16px;
    padding: 10px;
    margin: 10px;
    margin-bottom: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.bac-display {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 16px;
}

.bac-value {
    font-size: 3em;
    font-weight: bold;
    color: #dc3545;
    margin-bottom: 8px;
    line-height: 1;
}

.bac-value.safe {
    color: #28a745;
}

.bac-value.warning {
    color: #ffc107;
}

.status-message {
    font-size: 1.1em;
    margin-bottom: 16px;
    font-weight: 500;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 20px;
}

.detail-card {
    background: #f8f9fa;
    padding: 10px 16px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    border-right: 4px solid #667eea;
}

.detail-card h4 {
    margin-bottom: 8px;
    color: #333;
    font-size: 0.95em;
}

.detail-card p {
    color: #666;
    font-size: 1.1em;
    font-weight: 500;
}

.reset-btn {
    width: 100%;
    padding: 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    margin-bottom: 32px;
    min-height: 56px;
    font-size: 16px;
}

.reset-btn:active {
    transform: scale(0.98);
    background: #5a6268;
}

/* Loading state */
.calculating {
    pointer-events: none;
    opacity: 0.7;
}

.calculating .calculate-btn {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Form validation */
.invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

@media (max-width: 600px) {

    .kak-help{
        order: 3;
        margin-bottom: 32px;
        border-radius: 10px;
        padding: 20px 10px;
        padding-top: 240px;
        padding-left: 0px;
        text-align: center;
        background: url(https://alko-test.ru/assets/images/kak.jpg) top center no-repeat;
    }
    .alcotester-description h2 {
        font-size: 22px;
    }
}
@media (max-width: 400px) {

    .about h1{
        font-size: 22px;
    }
    .about{
        margin-left: 10px;
        margin-right: 10px;
    }
}