/* Модалки входу/акаунта (.auth-* / .acc-*) — спільні для default.hbs і автономної index.hbs.
   Винесено зі style.css, щоб головна (яка не вантажить style.css) теж мала стилі модалок.
   Використовує токени --st-* (є і в style.css, і в home.css). */

/* ========================== Модалка входу/реєстрації ============================ */
.auth-modal[hidden] { display: none; }

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.auth-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border: 1px solid var(--st-border);
    border-radius: 16px;
    padding: 32px 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

.auth-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: 0;
    color: var(--st-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.auth-modal__close:hover { color: var(--st-fg); }

.auth-modal__title {
    font-family: var(--st-serif);
    font-size: 1.7rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--st-fg);
    margin-bottom: 6px;
    text-align: center;
}

.auth-modal__subtitle {
    text-align: center;
    color: var(--st-muted);
    font-size: 0.95rem;
    margin: 0 0 20px;
}
.auth-modal__subtitle:empty { display: none; }

.auth-form__row { margin-bottom: 12px; }

.auth-form__input {
    width: 100%;
    padding: 13px 16px;
    border-radius: 8px;
    border: 1px solid var(--st-border-strong);
    background: #ffffff;
    color: var(--st-fg);
    font: inherit;
    font-size: 1rem;
}

.auth-form__input:focus {
    outline: none;
    border-color: var(--st-accent);
}

.auth-form__submit {
    width: 100%;
    margin-top: 4px;
    padding: 13px 16px;
    border: 0;
    border-radius: var(--st-radius-sm);
    background: var(--st-ink);
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.auth-form__submit:hover { opacity: 0.88; }
.auth-form__submit:disabled { opacity: 0.6; cursor: default; }

.auth-form__msg {
    min-height: 1.2em;
    margin-top: 12px;
    text-align: center;
    font-size: 0.92rem;
}

.auth-form__msg.is-ok { color: #0a7d3f; }
.auth-form__msg.is-err { color: #dc2626; }

.auth-form__switch {
    display: block;
    margin-top: 14px;
    text-align: center;
    color: var(--st-muted);
    text-decoration: none;
    font-size: 0.92rem;
}

.auth-form__switch:hover { color: var(--st-fg); }

/* ----- Попап акаунта ----- */
.acc-card {
    background: var(--st-soft);
    border: 1px solid var(--st-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
}

.acc-name { font-weight: 700; font-size: 1.05rem; }
.acc-email { color: var(--st-muted); font-size: 0.92rem; margin-top: 2px; }
.acc-plan-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0; }
.acc-plan-row + .acc-plan-row { border-top: 1px solid var(--st-border); }
.acc-plan-label { font-size: 0.88rem; color: var(--st-muted); flex-shrink: 0; }
.acc-plan { font-weight: 600; text-align: right; }
.acc-plan-date { font-weight: 500; text-align: right; }

/* Профіль у попапі акаунта: перегляд — ім'я на всю ширину, edit поруч з поштою */
.acc-id-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.acc-edit {
    background: none;
    border: 0;
    color: var(--st-accent);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 4px;
    flex-shrink: 0;
}
.acc-edit:hover { text-decoration: underline; }

/* Редагування імені в попапі акаунта */
.acc-field-label { display: block; font-size: 0.82rem; color: var(--st-muted); margin-bottom: 6px; }
.acc-name-cancel { width: auto; padding: 9px 14px; flex-shrink: 0; }
.acc-name-row { display: flex; flex-direction: column; gap: 10px; }
.acc-name-btns { display: flex; gap: 8px; justify-content: center; }
.acc-name-input {
    width: 100%;
    min-width: 0;
    padding: 9px 12px;
    color: var(--st-fg);
    background: #ffffff;
    border: 1px solid var(--st-border-strong);
    border-radius: 8px;
    outline: none;
    font: inherit;
}
.acc-name-input:focus { border-color: var(--st-accent); }
.acc-name-save { width: auto; padding: 9px 16px; flex-shrink: 0; }
.acc-name-msg { font-size: 0.85rem; margin-top: 6px; min-height: 1em; }
.acc-name-msg.is-ok { color: #0a7d3f; }
.acc-name-msg.is-err { color: #dc2626; }
.acc-email-hint { font-size: 0.8rem; color: var(--st-muted); margin-top: 8px; }

.acc-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.acc-btn {
    display: block;
    text-align: center;
    padding: 12px 16px;
    border-radius: var(--st-radius);
    border: 1px solid var(--st-border);
    background: transparent;
    color: var(--st-fg);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.acc-btn:hover { background: var(--st-soft); }

.acc-btn--primary {
    background: var(--st-ink);
    color: #ffffff;
    border-color: transparent;
}

.acc-btn--primary:hover { opacity: 0.88; background: var(--st-ink); }

.acc-btn--danger {
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.4);
}

.acc-btn--danger:hover { background: rgba(220, 38, 38, 0.08); }

.acc-btn[disabled] { opacity: 0.6; cursor: default; }

/* ===== Зміна тарифу в попапі акаунта ===== */
.acc-cp-back {
    background: none;
    border: 0;
    color: var(--st-muted);
    cursor: pointer;
    font: inherit;
    padding: 2px 0;
    margin-bottom: 10px;
}
.acc-cp-back:hover { color: var(--st-fg); }
.acc-cp-switch {
    display: flex;
    gap: 4px;
    background: #f3f4f6;
    border: 1px solid var(--st-border);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 14px;
}
.acc-cp-sw {
    flex: 1;
    border: 0;
    background: none;
    color: var(--st-muted);
    font: inherit;
    padding: 8px 0;
    border-radius: 7px;
    cursor: pointer;
}
.acc-cp-sw.is-active { background: var(--st-ink); color: #ffffff; }
.acc-cp[data-cad="month"] [data-cad-row="year"],
.acc-cp[data-cad="year"] [data-cad-row="month"] { display: none; }
.acc-cp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--st-border);
}
.acc-cp-row:last-child { border-bottom: 0; }
.acc-cp-name { font-weight: 600; }
.acc-cp-price { color: var(--st-muted); margin-left: 8px; font-size: 0.92rem; }
.acc-cp-cur { color: var(--st-muted); font-size: 0.9rem; }
.acc-cp-pick { width: auto; padding: 8px 18px; }
