/* Main Styles for Health Bloom App */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/web/Inter-Regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/web/Inter-SemiBold.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/web/Inter-Bold.woff2') format('woff2');
}

:root {
    --font-body-size: 16px;
    --font-secondary-size: 14px;
    --font-section-size: 18px;
    --font-screen-size: 24px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: var(--font-body-size);
    line-height: 1.5;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--tg-bg-color, #f8fafc);
    color: var(--tg-text-color, #0f172a);
    min-height: 100vh;
    overflow: hidden;
}

.h-screen-title,
.text-2xl {
    font-size: var(--font-screen-size);
    font-weight: 700;
    line-height: 1.2;
}

.h-section-title,
.text-xl,
.text-lg {
    font-size: var(--font-section-size);
    font-weight: 600;
    line-height: 1.3;
}

.text-body,
.text-base {
    font-size: var(--font-body-size);
    font-weight: 400;
    line-height: 1.5;
}

.text-secondary,
.text-sm {
    font-size: var(--font-secondary-size);
    font-weight: 400;
    opacity: 0.7;
}

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

.font-bold,
.font-extrabold,
.font-black {
    font-weight: 700;
}


a {
    color: inherit;
    text-decoration: none;
}

a:hover,
a:active {
    color: inherit;
    text-decoration: none;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.is-loading {
    opacity: 0.6;
}

.skeleton-line {
    height: 12px;
    border-radius: 9999px;
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    background-size: 200% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
}

.btn-confirmed {
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

/* Button Styles */
.btn-primary {
    /* Используем только внутреннюю дизайн-систему, без цветов Telegram-темы. */
    background: linear-gradient(135deg, #34d399 0%, #3b82f6 100%);
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(52, 211, 153, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(52, 211, 153, 0.4);
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-secondary {
    background: white;
    color: #0f172a;
    border: 2px solid #e2e8f0;
    border-radius: 9999px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

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

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

/* Card Styles */
.card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(241, 245, 249, 0.8);
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-out;
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Option Card */
.option-card {
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: 18px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.option-card:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

.option-card.selected {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-color: #34d399;
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.15);
}

/* Form Inputs */
.form-input {
    width: 100%;
    box-sizing: border-box;
    padding: 18px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 16px;
    font-family: inherit;
    background: white;
    transition: all 0.3s ease;
    color: #1e293b;
}

.form-input:focus {
    outline: none;
    border-color: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1);
}

.form-input::placeholder {
    color: #94a3b8;
}

input[type="date"].form-input {
    max-width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

input[type="time"].form-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
}

.diary-panel {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px 12px 72px;
    z-index: 60;
}

.diary-panel__card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 24px;
    padding: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    animation: diary-panel-in 0.2s ease;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.diary-fab-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 50;
}

.diary-fab__menu {
    position: fixed;
    left: 50%;
    bottom: 120px;
    transform: translateX(-50%);
    z-index: 70;
    background: white;
    border-radius: 20px;
    padding: 8px;
    min-width: 220px;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transform-origin: bottom right;
    animation: diary-fab-in 0.18s ease;
}

.diary-fab__item {
    border: none;
    background: #f8fafc;
    border-radius: 14px;
    padding: 10px 12px;
    text-align: left;
    font-size: 14px;
    color: #0f172a;
    cursor: pointer;
}

.diary-fab__item:hover {
    background: #eef2ff;
}

@keyframes diary-panel-in {
    from {
        transform: translateY(16px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes diary-fab-in {
    from {
        transform: translateX(-50%) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
}

input,
select,
textarea {
    font-size: 16px;
}

.telegram-auth-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.72);
    z-index: 9999;
    padding: 24px;
}

.telegram-auth-locked {
    overflow: hidden;
}

.telegram-auth-locked > * {
    visibility: hidden;
}

.telegram-auth-locked .telegram-auth-overlay {
    visibility: visible;
}

.telegram-auth-overlay__card {
    max-width: 360px;
    width: 100%;
    background: #ffffff;
    border-radius: 24px;
    padding: 28px;
    text-align: center;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
    color: #0f172a;
}

.telegram-auth-overlay__card h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 12px 0 8px;
}

.telegram-auth-overlay__card p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.telegram-auth-overlay__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    padding: 12px 18px;
    border-radius: 999px;
    background: #10b981;
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.25);
}

.telegram-auth-overlay__button:active {
    background: #059669;
}

.telegram-auth-overlay__icon {
    font-size: 32px;
}

/* Бейдж для DEV режима */
.dev-mode-badge {
    position: fixed;
    bottom: 16px;
    right: 16px;
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 6px 10px;
    border-radius: 999px;
    z-index: 9998;
    text-transform: uppercase;
}

@media (hover: none) {
    .btn-primary:hover,
    .btn-secondary:hover,
    .option-card:hover,
    .card:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Progress Ring */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

/* Utility Classes */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

.animate-pulse-subtle {
    animation: pulse 2s infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .card {
        border-radius: 20px;
        padding: 20px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .form-input {
        padding: 16px;
        border-radius: 14px;
    }
}

@media (max-width: 380px) {
    .card {
        border-radius: 18px;
        padding: 18px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 12px 18px;
        font-size: 14px;
    }
}
