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

:root {
    --primary-color: #0088cc;
    --primary-dark: #0070a0;
    --secondary-color: #ff5722;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --bg-light: #f5f7fa;
    --bg-white: #ffffff;
    --text-dark: #212121;
    --text-light: #757575;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 0%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 20px;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header .subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* Content */
.content {
    flex: 1;
}

.form-section,
.results-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 251, 252, 0.98) 100%);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.form-section h2,
.results-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-dark);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 12px;
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
}

/* Date Cards */
.date-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 251, 252, 0.95) 100%);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    padding: 18px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.date-card:hover {
    border-color: rgba(0, 136, 204, 0.3);
    box-shadow: 0 12px 48px rgba(0, 136, 204, 0.2);
    transform: translateY(-4px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 253, 0.98) 100%);
}

.date-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.date-card-icon {
    font-size: 24px;
}

.date-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #000000 !important;
    background: #ffffff !important;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    font-family: inherit;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

input[type="date"] {
    color-scheme: light;
    color: #000000 !important;
}

/* Явно устанавливаем цвет для всех элементов датепикера */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0);
}

input[type="date"]::-webkit-datetime-edit {
    color: #000000 !important;
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    color: #000000 !important;
}

input[type="date"]::-webkit-datetime-edit-text {
    color: #000000 !important;
}

input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
    color: #000000 !important;
}

/* Стиль иконки календаря */
.date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    border-radius: 4px;
    margin-right: 6px;
    opacity: 0.7;
    filter: invert(0.3);
    transition: all 0.3s ease;
    width: 24px;
    height: 24px;
}

.date-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    filter: invert(0);
}

/* Стили текста в датепикере */
.date-input::-webkit-datetime-edit {
    padding: 4px 0;
}

.date-input::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

.date-input::-webkit-datetime-edit-text {
    color: var(--text-light);
    padding: 0 2px;
}

.date-input::-webkit-datetime-edit-month-field,
.date-input::-webkit-datetime-edit-day-field,
.date-input::-webkit-datetime-edit-year-field {
    color: var(--text-dark);
    font-weight: 700;
}

/* Firefox стили */
.date-input::-moz-calendar-picker-icon {
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.date-input::-moz-calendar-picker-icon:hover {
    opacity: 1;
}

/* Firefox светлая тема */
input[type="date"]::-moz-calendar-picker-icon {
    filter: invert(0);
}

/* Edge/IE стили */
.date-input::-ms-clear,
.date-input::-ms-expand {
    display: none;
}

.date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 136, 204, 0.15),
                0 4px 16px rgba(102, 126, 234, 0.25);
    background: #ffffff !important;
    color: #000000 !important;
    transform: translateY(-2px);
}

.date-input:disabled {
    background: #f0f0f0 !important;
    color: #999 !important;
    cursor: not-allowed;
    border-color: #ddd;
}

.date-display {
    display: block;
    font-size: 13px;
    color: var(--text-light);
    margin-top: 8px;
    padding-left: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.date-display.filled {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 14px;
    text-shadow: 0 2px 4px rgba(0, 136, 204, 0.1);
}

/* Dark mode для датепикера */
@media (prefers-color-scheme: dark) {
    .date-input {
        background: #2a2a2a;
        color: white;
        border-color: #404040;
    }

    .date-input:focus {
        border-color: var(--primary-color);
        background: #1e1e1e;
    }
}

/* Buttons */
.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--primary-color);
    margin-top: 20px;
}

.btn-secondary:hover {
    background: #e8eef7;
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 18px;
}

.btn-text {
    flex: 1;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Steps Container */
.steps-container {
    display: none; /* Скрыть все шаги */
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .steps-container {
        grid-template-columns: 1fr;
    }
}

.step {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid var(--primary-color);
}

.step h3 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.step-content p {
    font-size: 13px;
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.step-content .value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 16px;
}

.step-content .highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    display: inline-block;
}

/* Final Result */
.final-result {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 32px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}

.final-result h2 {
    font-size: 16px;
    margin-bottom: 16px;
    border-bottom: none;
    padding-bottom: 0;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.number-display {
    font-size: 72px;
    font-weight: 700;
    margin: 20px 0;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.meaning {
    font-size: 14px;
    line-height: 1.8;
    opacity: 0.95;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.meaning-title {
    font-size: 18px;
    font-weight: 700;
    margin: 20px 0 12px 0;
    color: white;
}

.meaning-energy {
    font-size: 14px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-left: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.meaning-key {
    font-size: 15px;
    font-weight: 700;
    color: #FFE082;
    margin: 16px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.meaning-section {
    margin-top: 18px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.meaning-section h3 {
    font-size: 13px;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meaning-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.meaning-section li {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin: 8px 0;
    padding-left: 0;
    line-height: 1.6;
}

.meaning-section p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    margin: 0;
}

.meaning-section.warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.meaning-section.warning p {
    color: #FFE082;
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 251, 252, 0.98) 100%);
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.spinner {
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    font-size: 16px;
    color: var(--text-light);
    font-weight: 500;
}

/* Error */
.error {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.1) 0%, rgba(244, 67, 54, 0.05) 100%);
    border: 2px solid var(--error-color);
    color: var(--error-color);
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* Footer */
.footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    padding: 20px;
    margin-top: auto;
}

.footer-tagline {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 8px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 16px;
    }

    .header h1 {
        font-size: 24px;
    }

    .form-section,
    .results-section {
        padding: 16px;
    }

    .final-result {
        padding: 24px;
    }

    .number-display {
        font-size: 56px;
    }

    .date-inputs {
        grid-template-columns: repeat(3, 1fr);
    }
}
