/* =============================================================
   FLOWLY — EDITOR DE HÁBITO (modal de habits.js → openHabitEditor)
   A tela Rotina saiu em 2026-09-28 (virou a aba Hábitos de Análises,
   estilizada em css/views/analytics.css); daqui só sobrou o modal.
   Depende de: _tokens.css, _components.css
   ============================================================= */

/* ============================================================
   MODAL — editor de hábito
   ============================================================ */

.habit-editor .flowly-modal__content {
    max-width: 460px;
}
.habit-editor__card {
    background: var(--flowly-bg-elevated, rgba(20, 22, 28, 0.98));
    border: 1px solid var(--flowly-border-muted, rgba(255, 255, 255, 0.1));
}

.habit-editor__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--flowly-border-subtle, rgba(0, 0, 0, 0.08));
}
.habit-editor__eyebrow {
    font-size: calc(11px * var(--flowly-text-k));
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--flowly-accent-primary, #22c55e);
    margin-bottom: 4px;
}
.habit-editor__title {
    margin: 0;
    font-size: calc(18px * var(--flowly-text-k));
    font-weight: 700;
    color: var(--flowly-text-primary);
    letter-spacing: -0.02em;
}
.habit-editor__close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: calc(8px * var(--flowly-radius-k));
    color: var(--flowly-text-tertiary);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.habit-editor__close:hover {
    background: var(--flowly-bg-glass, rgba(0, 0, 0, 0.06));
    color: var(--flowly-text-primary);
}

.habit-editor__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px 20px;
}
.habit-editor__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.habit-editor__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.habit-editor__label {
    font-size: calc(12px * var(--flowly-text-k));
    font-weight: 600;
    color: var(--flowly-text-secondary);
    letter-spacing: 0.02em;
}
.habit-editor__input,
.habit-editor__select {
    height: 38px;
    padding: 0 12px;
    background: var(--flowly-bg-glass, rgba(0, 0, 0, 0.04));
    border: 1px solid var(--flowly-border-subtle, rgba(0, 0, 0, 0.08));
    border-radius: var(--flowly-radius-md, 8px);
    color: var(--flowly-text-primary);
    font-size: calc(14px * var(--flowly-text-k));
    font-family: inherit;
    outline: none;
    transition: background 0.12s, border-color 0.12s;
    color-scheme: light dark;
}
.habit-editor__input::placeholder { color: var(--flowly-text-tertiary); }
.habit-editor__input:focus,
.habit-editor__select:focus {
    border-color: var(--flowly-accent-primary, #22c55e);
    background: var(--flowly-bg-glass-strong, rgba(0, 0, 0, 0.07));
}

.habit-editor__days {
    display: flex;
    gap: 6px;
}
.habit-editor__day {
    flex: 1;
    height: 38px;
    font-size: calc(13px * var(--flowly-text-k));
    font-weight: 700;
    background: var(--flowly-bg-glass, rgba(0, 0, 0, 0.04));
    border: 1px solid var(--flowly-border-subtle, rgba(0, 0, 0, 0.08));
    border-radius: var(--flowly-radius-md, 8px);
    color: var(--flowly-text-tertiary);
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.18s var(--flowly-ease-out, ease);
    font-family: inherit;
}
.habit-editor__day:hover {
    background: var(--flowly-bg-glass-hover, rgba(0, 0, 0, 0.07));
    color: var(--flowly-text-primary);
}
.habit-editor__day[aria-pressed="true"] {
    background: var(--flowly-accent-primary, #22c55e);
    color: #000;
    border-color: var(--flowly-accent-primary, #22c55e);
    transform: translateY(-1px);
}

.habit-editor__hint {
    margin: 0;
    padding: 8px 12px;
    font-size: calc(12px * var(--flowly-text-k));
    background: var(--flowly-bg-glass, rgba(0, 0, 0, 0.04));
    border: 1px solid var(--flowly-border-subtle, rgba(0, 0, 0, 0.08));
    border-radius: var(--flowly-radius-sm, 6px);
    color: var(--flowly-text-tertiary);
    line-height: 1.5;
}

.habit-editor__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}
.habit-editor__btn {
    height: 38px;
    padding: 0 18px;
    font-size: calc(13px * var(--flowly-text-k));
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--flowly-radius-md, 8px);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s, transform 0.18s var(--flowly-ease-out, ease), box-shadow 0.18s ease;
}
.habit-editor__btn--ghost {
    background: transparent;
    color: var(--flowly-text-secondary);
    border-color: var(--flowly-border-subtle, rgba(0, 0, 0, 0.08));
}
.habit-editor__btn--ghost:hover {
    background: var(--flowly-bg-glass, rgba(0, 0, 0, 0.04));
    color: var(--flowly-text-primary);
}
.habit-editor__btn--primary {
    background: var(--flowly-accent-primary, #22c55e);
    color: #000;
    font-weight: 700;
}
.habit-editor__btn--primary:hover {
    background: color-mix(in srgb, var(--flowly-accent-primary, #22c55e) 88%, white);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.25);
}

@media (max-width: 560px) {
    .habit-editor__row { grid-template-columns: 1fr; }
    .habit-editor__days { flex-wrap: wrap; }
    .habit-editor__day { flex: 0 1 calc(14.28% - 6px); min-width: 36px; }
}
