/* =====================================================
   Стили сайта стоматологической клиники "ДентаЛайн"
   ===================================================== */

/* CSS-переменные */
:root {
    --primary:        #00a8a8;
    --primary-dark:   #007878;
    --primary-light:  #e0f5f5;
    --secondary:      #1e3a5f;
    --accent:         #ff6b6b;
    --bg:             #ffffff;
    --bg-gray:        #f5f8fa;
    --text:           #2c3e50;
    --text-muted:     #7f8c8d;
    --border:         #e1e8ed;
    --success:        #27ae60;
    --warning:        #f39c12;
    --error:          #e74c3c;
    --radius:         8px;
    --radius-lg:      16px;
    --shadow:         0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg:      0 8px 24px rgba(0, 0, 0, 0.08);
    --transition:     all 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

.container        { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 720px;  margin: 0 auto; padding: 0 20px; }

.text-center { text-align: center; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.muted { color: var(--text-muted); }
.required { color: var(--error); }

/* ============ Шапка ============ */
.site-header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--secondary);
    font-weight: 700;
    font-size: 22px;
}
.logo-icon { font-size: 28px; }

.main-nav { display: flex; gap: 28px; }
.main-nav a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: var(--transition);
    padding: 4px 0;
    position: relative;
}
.main-nav a:hover { color: var(--primary); }
.main-nav a.active { color: var(--primary); }
.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-phone {
    text-decoration: none;
    color: var(--secondary);
    font-weight: 600;
    font-size: 15px;
}

/* ============ Кнопки ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}
.btn-sm  { padding: 7px 14px;  font-size: 14px; }
.btn-lg  { padding: 14px 28px; font-size: 17px; }

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-secondary {
    background: var(--secondary);
    color: white;
}
.btn-secondary:hover { background: #152a45; }

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-gray); }

/* ============ Hero ============ */
.hero {
    background: linear-gradient(135deg, var(--primary-light) 0%, #ffffff 100%);
    padding: 80px 0;
}
.hero-inner {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 60px;
    align-items: center;
}
.hero h1 {
    font-size: 52px;
    line-height: 1.1;
    color: var(--secondary);
    margin-bottom: 24px;
    font-weight: 800;
}
.hero-subtitle {
    font-size: 19px;
    color: var(--text-muted);
    margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 12px; margin-bottom: 48px; flex-wrap: wrap; }
.hero-features {
    display: flex;
    gap: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.hero-feature strong {
    display: block;
    font-size: 28px;
    color: var(--primary);
    font-weight: 800;
}
.hero-feature span {
    color: var(--text-muted);
    font-size: 14px;
}
.hero-image { display: flex; justify-content: center; }
.hero-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 320px;
}
.hero-card-icon { font-size: 64px; margin-bottom: 16px; }
.hero-card h3 { color: var(--secondary); margin-bottom: 8px; }
.hero-card p  { color: var(--text-muted); }

/* ============ Секции ============ */
.section { padding: 72px 0; }
.section-gray { background: var(--bg-gray); }

.section-title {
    font-size: 38px;
    text-align: center;
    color: var(--secondary);
    margin-bottom: 12px;
    font-weight: 800;
}
.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 17px;
    margin-bottom: 48px;
}

.page-header {
    background: var(--bg-gray);
    padding: 60px 0;
}
.page-header h1 {
    font-size: 42px;
    color: var(--secondary);
    margin-bottom: 8px;
}
.page-header p { color: var(--text-muted); font-size: 17px; }

/* ============ Услуги ============ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.service-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.service-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.service-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    width: max-content;
}
.service-card h3 { color: var(--secondary); margin-bottom: 10px; font-size: 19px; }
.service-card p  { color: var(--text-muted); margin-bottom: 20px; flex-grow: 1; font-size: 15px; }
.service-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.service-price { font-size: 22px; font-weight: 700; color: var(--primary); }

.services-table {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    margin-bottom: 32px;
}
.services-table table { width: 100%; border-collapse: collapse; }
.services-table th {
    background: var(--bg-gray);
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.services-table td {
    padding: 16px;
    border-top: 1px solid var(--border);
}
.services-table .price { font-weight: 700; color: var(--primary); white-space: nowrap; }
.service-desc { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.spec-title {
    font-size: 26px;
    color: var(--secondary);
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

/* ============ Преимущества ============ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
}
.feature { text-align: center; }
.feature-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    box-shadow: var(--shadow);
}
.feature h3 { margin-bottom: 8px; color: var(--secondary); }
.feature p  { color: var(--text-muted); }

/* ============ Врачи ============ */
.doctors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}
.doctors-grid-large {
    grid-template-columns: repeat(auto-fill, minmax(540px, 1fr));
}
.doctor-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.doctor-card-large {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 24px;
    text-align: left;
    padding: 28px;
}
.doctor-photo {
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 700;
}
.doctor-photo-large {
    width: 140px;
    height: 140px;
    margin: 0;
}
.doctor-card h3 { color: var(--secondary); margin-bottom: 6px; font-size: 18px; }
.doctor-spec { color: var(--primary); font-weight: 600; margin-bottom: 8px; }
.doctor-exp { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }
.doctor-meta { color: var(--text-muted); margin-bottom: 12px; }
.doctor-edu, .doctor-bio { font-size: 14px; margin-bottom: 12px; color: var(--text); }

/* ============ CTA ============ */
.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    text-align: center;
}
.cta-section h2 { font-size: 36px; margin-bottom: 12px; }
.cta-section p  { margin-bottom: 24px; font-size: 18px; opacity: 0.9; }
.cta-section .btn-primary { background: white; color: var(--primary-dark); }
.cta-section .btn-primary:hover { background: var(--bg-gray); }

/* ============ Формы ============ */
.appointment-form, .auth-form, .review-form {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
}
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary);
    font-size: 15px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    min-height: 60px;
}
.slot-btn {
    padding: 10px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}
.slot-btn:hover { border-color: var(--primary); color: var(--primary); }
.slot-btn.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.auth-hint {
    text-align: center;
    margin-top: 16px;
    color: var(--text-muted);
}
.auth-hint a { color: var(--primary); text-decoration: none; }
.demo-creds {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-gray);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-muted);
}

/* ============ Алерты ============ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 15px;
}
.alert-success { background: #e8f8ef; color: #1e6b3a; border: 1px solid #b7e4c7; }
.alert-error   { background: #fde8e8; color: #a02020; border: 1px solid #f5c2c2; }
.alert-info    { background: var(--primary-light); color: var(--primary-dark); }

/* ============ Личный кабинет ============ */
.cabinet-info {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.cabinet-info h3 { margin-bottom: 12px; color: var(--secondary); }
.cabinet-info p  { margin-bottom: 6px; }

.appointments-list { display: flex; flex-direction: column; gap: 16px; }
.appointment-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 24px;
    align-items: center;
}
.appointment-date {
    text-align: center;
    padding: 12px 20px;
    background: var(--primary-light);
    border-radius: var(--radius);
    min-width: 140px;
}
.appointment-date strong {
    display: block;
    color: var(--secondary);
    font-size: 15px;
}
.appointment-date span {
    color: var(--primary);
    font-size: 20px;
    font-weight: 700;
}
.appointment-info h4 { color: var(--secondary); margin-bottom: 6px; }
.appointment-info p  { color: var(--text-muted); font-size: 14px; margin-bottom: 4px; }

.status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
}
.status-pending   { background: #fff4dc; color: #b07406; }
.status-confirmed { background: #d6f5e3; color: #1e6b3a; }
.status-completed { background: #e3eaf5; color: #2c3e50; }
.status-cancelled { background: #fde8e8; color: #a02020; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.data-table th {
    background: var(--bg-gray);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--secondary);
    font-size: 13px;
    text-transform: uppercase;
}
.data-table td { padding: 12px 14px; border-top: 1px solid var(--border); font-size: 14px; }

/* ============ Отзывы ============ */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}
.review-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.stars { color: #f5b301; letter-spacing: 1px; }
.review-doctor { color: var(--text-muted); font-size: 14px; margin-bottom: 8px; }
.review-text { margin-bottom: 12px; }
.review-date { color: var(--text-muted); font-size: 13px; }

.review-form-wrap {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
}
.review-form-wrap h2 { margin-bottom: 16px; color: var(--secondary); }

.rating-input { display: inline-flex; flex-direction: row-reverse; }
.rating-input input { display: none; }
.rating-input label {
    font-size: 28px;
    color: #ddd;
    cursor: pointer;
    padding: 0 2px;
}
.rating-input input:checked ~ label,
.rating-input label:hover,
.rating-input label:hover ~ label { color: #f5b301; }

/* ============ Контакты ============ */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}
.contact-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: center;
    box-shadow: var(--shadow);
}
.contact-icon { font-size: 40px; margin-bottom: 12px; }
.contact-card h3 { color: var(--secondary); margin-bottom: 8px; }
.contact-card p  { color: var(--text-muted); margin-bottom: 4px; }
.contact-card a  { color: var(--primary); text-decoration: none; }
.map-placeholder {
    background: var(--bg-gray);
    border-radius: var(--radius-lg);
    padding: 80px 20px;
    text-align: center;
}
.map-stub h3 { color: var(--secondary); margin-bottom: 12px; }

/* ============ Фильтры ============ */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}
.filter-chip {
    padding: 8px 16px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 24px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============ Подвал ============ */
.site-footer {
    background: var(--secondary);
    color: white;
    margin-top: 80px;
}
.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    padding: 56px 20px 32px;
}
.footer-col h4 { margin-bottom: 16px; font-size: 16px; }
.footer-col p  { opacity: 0.85; margin-bottom: 6px; font-size: 14px; }
.footer-col a  { color: white; text-decoration: none; }
.footer-col a:hover { text-decoration: underline; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 14px;
    opacity: 0.8;
}

/* ============ Адаптив ============ */
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; text-align: center; }
    .hero h1 { font-size: 38px; }
    .hero-features { justify-content: center; }
    .doctor-card-large { grid-template-columns: 1fr; text-align: center; }
    .doctor-photo-large { margin: 0 auto; }
    .main-nav { display: none; }
    .form-row { grid-template-columns: 1fr; }
    .appointment-card { grid-template-columns: 1fr; text-align: center; }
}
