/* ======================================
   Medical Landing Pages - Shared Styles
   ====================================== */

/* ======================================
   Reset & Base
   ====================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-card: #2a2a2a;
    --bg-card-light: #f4f5f2;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-on-light: #171717;
    --accent-purple: #8b7bf7;
    --accent-green: #bfff00;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ======================================
   Header
   ====================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid #222;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-img {
    width: 40px;
    height: 40px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-cta {
    background: var(--accent-green);
    color: #000;
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 600;
    text-decoration: none;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.header-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(191, 255, 0, 0.3);
}

/* Header Right Section */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Header Auth */
.header-auth {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-login {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.header-login:hover {
    color: var(--text-primary);
}

.header-user-name {
    color: var(--text-primary);
    font-weight: 500;
    text-decoration: none;
}

.header-user-star {
    color: #ffd700;
    margin-left: 4px;
    font-size: 14px;
}

.header-user-conditions {
    color: var(--text-secondary);
    margin-left: 4px;
    font-size: 13px;
    font-weight: 400;
}

/* ======================================
   Main Layout
   ====================================== */
.main {
    max-width: 700px;
    margin: 0 auto;
    padding: 120px 24px 60px;
}

/* ======================================
   Hero Section
   ====================================== */
.hero {
    text-align: center;
    margin-bottom: 48px;
}

.hero h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.hero p {
    font-size: 18px;
    color: var(--text-secondary);
}

/* Form consent text */
.form-consent {
    margin-top: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.form-consent a {
    color: var(--text-secondary);
    text-decoration: underline;
    transition: color 0.2s;
}

.form-consent a:hover {
    color: var(--text-primary);
}

/* ======================================
   Footer
   ====================================== */
.footer {
    padding: 40px 24px;
    text-align: center;
    border-top: 1px solid #222;
}

.footer p {
    font-size: 14px;
    color: var(--text-secondary);
}

.footer-support {
    margin-bottom: 16px;
    font-size: 14px;
}

.footer-support a {
    color: var(--accent-purple);
    text-decoration: none;
}

.footer-support a:hover {
    text-decoration: underline;
}

.footer p.footer-company {
    margin-top: 8px;
    font-size: 12px;
    color: #444;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.footer p.footer-disclaimer {
    margin-top: 12px;
    font-size: 12px;
    color: #444;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ======================================
   App store badges (AppMetrica SmartLinks)
   ====================================== */
.app-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.app-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 190px;
    padding: 10px 22px;
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: 14px;
    color: var(--text-primary);
    text-decoration: none;
    transition:
        transform 0.2s,
        border-color 0.2s,
        box-shadow 0.2s;
}

.app-badge:hover {
    transform: translateY(-3px);
    border-color: var(--accent-purple);
    box-shadow: 0 12px 30px rgba(139, 123, 247, 0.15);
}

.app-badge-icon {
    display: inline-flex;
    flex-shrink: 0;
    color: var(--text-primary);
}

.app-badge-icon img {
    display: block;
    width: auto;
    height: 28px;
}

.app-badge-label {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: left;
}

.app-badge-top {
    font-size: 11px;
    color: var(--text-secondary);
}

.app-badge-bottom {
    font-size: 17px;
    font-weight: 600;
}

/* App badges inside the footer */
.footer-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}

/* Login Modal */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.login-modal {
    background: var(--bg-secondary);
    border: 1px solid #333;
    border-radius: 20px;
    padding: 40px 32px;
    max-width: 400px;
    width: 100%;
    position: relative;
    animation: slideUp 0.3s ease;
}

.login-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 24px;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.login-close-btn:hover {
    color: var(--text-primary);
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
    margin-bottom: 24px;
}

.login-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-option {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.login-option--hidden {
    display: none;
}

.login-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 12px 20px;
    background: #fff;
    color: #1f1f1f;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
}

.login-google-btn:hover {
    opacity: 0.9;
}

.login-google-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.login-divider {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Login method switch link */
.login-method-switch {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    width: 100%;
    padding: 6px 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.login-method-switch:hover {
    color: var(--accent-purple);
}

/* Resend code button (with countdown) */
.login-resend-btn {
    background: none;
    border: none;
    color: var(--accent-purple);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    width: 100%;
    padding: 4px 0;
    transition: color 0.2s;
}

.login-resend-btn:hover:not(:disabled) {
    text-decoration: underline;
}

.login-resend-btn:disabled {
    color: var(--text-secondary);
    cursor: default;
}

/* Email login form */
.login-email-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-email-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: -4px;
}

.login-email-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid #333;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.login-email-input:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.login-email-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Country picker (intl-tel-input); its stylesheet is inserted before this one, so these :root values win */
:root {
    --iti-country-selector-bg: var(--bg-secondary);
    --iti-border-color: #333;
    --iti-hover-color: rgba(255, 255, 255, 0.08);
    --iti-icon-color: var(--text-secondary);
}

.iti {
    width: 100%;
    color: var(--text-primary);
}

.iti__search-input {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Email suggestions (DaData) */
.login-suggest-wrap {
    position: relative;
}

.login-suggest {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 10;
    margin: 0;
    padding: 4px;
    list-style: none;
    /* Fits EMAIL_SUGGEST_COUNT items (login.js) */
    max-height: 240px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.login-suggest--open {
    display: block;
}

.login-suggest-item {
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.2s;
}

.login-suggest-item:hover,
.login-suggest-item--active {
    background: var(--bg-primary);
}

/* Code input */
.login-code-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.4;
}

.login-code-container {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.login-code-box {
    width: 48px;
    height: 56px;
    background: var(--bg-primary);
    border: 2px solid #333;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    font-family: inherit;
    transition:
        border-color 0.2s,
        transform 0.1s;
}

.login-code-box:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.login-code-box--error {
    border-color: #ff4d4d;
    animation: shake 0.5s;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-4px);
    }
    75% {
        transform: translateX(4px);
    }
}

/* Submit button */
.login-submit-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--accent-purple);
    color: var(--text-primary);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition:
        background 0.2s,
        opacity 0.2s;
}

.login-submit-btn:hover:not(:disabled) {
    background: #9d8bff;
}

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

/* Error message */
.login-error {
    color: #ff4d4d;
    font-size: 14px;
    text-align: center;
    display: none;
    line-height: 1.4;
}

/* ======================================
   Legal Pages
   ====================================== */
.legal-page {
    padding-top: 100px;
}

.legal-page h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.legal-page .legal-date {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.legal-content {
    line-height: 1.7;
    font-size: 15px;
}

.legal-content p {
    margin-bottom: 16px;
}

.legal-content ul {
    margin-bottom: 16px;
    padding-left: 24px;
}

/* Hierarchical clause numbers (5.6.2) */
.legal-content ol {
    counter-reset: legal-clause;
    list-style: none;
    margin-bottom: 16px;
    padding-left: 0;
}

.legal-content ol > li {
    counter-increment: legal-clause;
    padding-left: 44px;
    position: relative;
}

.legal-content ol > li::before {
    content: counters(legal-clause, '.') '.';
    position: absolute;
    left: 0;
    white-space: nowrap;
}

.legal-content li {
    margin-bottom: 8px;
}

.legal-content ol ol,
.legal-content ul ul {
    margin-top: 8px;
    margin-bottom: 8px;
}

.legal-content strong {
    font-weight: 600;
}

.legal-content a {
    color: var(--accent-purple);
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

.legal-content blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 3px solid var(--accent-purple);
    background: rgba(139, 123, 247, 0.1);
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.legal-content blockquote p {
    margin-bottom: 0;
}

/* Footer columns */
.footer-columns {
    display: flex;
    justify-content: center;
    gap: 64px;
    margin-bottom: 32px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.footer-col h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.footer-col a {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .footer-columns {
        flex-direction: column;
        gap: 24px;
        align-items: center;
    }

    .footer-col {
        text-align: left;
    }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.medical-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 14px 28px;
    border-radius: 12px;
    border: 1px solid #333;
    font-size: 15px;
    white-space: nowrap;
    z-index: 3000;
    opacity: 0;
    transition:
        opacity 0.3s,
        transform 0.3s;
    pointer-events: none;
}

.medical-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ======================================
   Responsive Design
   ====================================== */
@media (max-width: 600px) {
    .header {
        padding: 12px 16px;
        box-sizing: border-box;
    }

    .header-right {
        gap: 10px;
    }

    .logo {
        gap: 8px;
    }

    .logo-img {
        width: 32px;
        height: 32px;
    }

    .logo-text {
        font-size: 20px;
    }

    .header-cta {
        padding: 8px 14px;
        font-size: 13px;
        white-space: nowrap;
    }

    .header-auth {
        display: flex;
    }

    /* Show only icon on mobile for login */
    .header-login {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0;
        background: var(--bg-card);
        border: 1px solid #333;
        border-radius: 8px;
        transition: background 0.2s;
    }

    .header-login::before {
        content: '👤';
        font-size: 18px;
    }

    .header-login:hover {
        background: var(--bg-secondary);
    }

    /* Mobile: User name */
    .header-user-name {
        font-size: 13px;
    }

    .main {
        padding: 100px 16px 40px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 17px;
    }

    .widget {
        padding: 24px 16px;
    }

    .medical-toast {
        bottom: 20px;
        font-size: 14px;
        padding: 12px 20px;
        max-width: calc(100% - 40px);
        white-space: normal;
        text-align: center;
    }

    .login-modal {
        padding: 32px 24px;
        margin: 0 16px;
    }

    .login-title {
        font-size: 20px;
    }

    .login-subtitle {
        font-size: 14px;
    }

    .login-code-box {
        width: 44px;
        height: 52px;
        font-size: 22px;
    }

    .login-code-container {
        gap: 6px;
    }
}

/* ============================================
   TARIFF CARDS (shared — rendered by billing.js)
   ============================================ */

.tariff-card {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid #333;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: relative;
    transition:
        border-color 0.3s,
        box-shadow 0.3s;
}

.tariff-card--highlighted {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 1px var(--accent-green);
}

.tariff-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-green);
    color: #000;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 100px;
    white-space: nowrap;
}

.tariff-badge--muted {
    background: #444;
    color: var(--text-secondary);
}

.tariff-starburst {
    position: absolute;
    top: -22px;
    right: -22px;
    width: 110px;
    height: 110px;
    background: #ffd700;
    clip-path: polygon(
        50% 0%,
        63% 14%,
        78% 5%,
        80% 22%,
        97% 25%,
        88% 40%,
        100% 50%,
        88% 60%,
        97% 75%,
        80% 78%,
        78% 95%,
        63% 86%,
        50% 100%,
        37% 86%,
        22% 95%,
        20% 78%,
        3% 75%,
        12% 60%,
        0% 50%,
        12% 40%,
        3% 25%,
        20% 22%,
        22% 5%,
        37% 14%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(12deg);
    z-index: 1;
}

.tariff-starburst__text {
    font-size: 11px;
    font-weight: 700;
    color: #0a0a0a;
    text-align: center;
    line-height: 1.2;
    padding: 22px;
    transform: rotate(-12deg);
}

.tariff-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
}

.tariff-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.tariff-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.tariff-price-old {
    font-size: 20px;
    color: var(--text-secondary);
    text-decoration: line-through;
    margin-right: 4px;
}

.tariff-price-amount {
    font-size: 52px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
    letter-spacing: -2px;
}

.tariff-price-currency {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.tariff-price-period {
    font-size: 16px;
    color: var(--text-secondary);
    margin-left: 2px;
}

.tariff-price-annotation {
    font-size: 14px;
    color: var(--text-secondary);
    margin-left: 4px;
}

.tariff-recurring-info {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tariff-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tariff-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.tariff-feature {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
}

.tariff-feature-check {
    color: var(--accent-green);
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.tariff-button {
    display: block;
    text-align: center;
    padding: 16px 24px;
    border-radius: 100px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    background: transparent;
    border: 1px solid #444;
    color: var(--text-primary);
    cursor: pointer;
    transition:
        background 0.2s,
        border-color 0.2s,
        transform 0.2s,
        box-shadow 0.2s;
}

.tariff-button:hover {
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

.tariff-button--highlighted {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: #000;
}

.tariff-button--highlighted:hover {
    border-color: var(--accent-green);
    box-shadow: 0 10px 30px rgba(191, 255, 0, 0.3);
}
