/**
 * Hano Account Widget CSS
 * Version: 1.1.4
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ─── Variables ─────────────────────────────────────────────────────────────── */
:root {
    --hano-accent:       #2c2525;
    --hano-accent-hover: #3d3535;
    --hano-border:       #e5e7eb;
    --hano-text:         #111827;
    --hano-muted:        #6b7280;
    --hano-light:        #f3f4f6;
    --hano-radius:       14px;
    --hano-radius-sm:    8px;
    --hano-shadow:       0 4px 24px rgba(0,0,0,0.08);
}

/* ─── App container ─────────────────────────────────────────────────────────── */
#hano-account-app {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    color: var(--hano-text);
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: transparent;
    box-sizing: border-box;
}

/* ─── Card ──────────────────────────────────────────────────────────────────── */
.hano-account-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: var(--hano-shadow);
    padding: 44px 48px;
    width: 100%;
    box-sizing: border-box;
}

/* ─── Login View ────────────────────────────────────────────────────────────── */
.hano-account-login {
    max-width: 480px;
    margin: 0 auto;
}

.hano-account-login__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--hano-text);
    text-align: center;
    margin: 0 0 8px;
}

.hano-account-login__subtitle {
    font-size: 15px;
    color: var(--hano-muted);
    text-align: center;
    margin: 0 0 32px;
}

/* ─── Form Groups ───────────────────────────────────────────────────────────── */
.hano-account-form__group {
    margin-bottom: 18px;
}

.hano-account-form__label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--hano-text);
    margin-bottom: 7px;
}

.hano-account-form__input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.hano-account-form__icon {
    position: absolute;
    left: 14px;
    color: var(--hano-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 1;
}

.hano-account-form__input,
.hano-account-form__select {
    width: 100%;
    box-sizing: border-box;
    height: 48px;
    padding: 0 16px;
    border: 1.5px solid var(--hano-border) !important;
    border-radius: var(--hano-radius) !important;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: var(--hano-text);
    background: #ffffff !important;
    outline: none;
    transition: border-color 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.hano-account-form__select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    padding-right: 40px !important;
}

.hano-account-form__input--icon {
    padding-left: 42px !important;
}

.hano-account-form__input:focus,
.hano-account-form__select:focus {
    border-color: var(--hano-accent) !important;
    box-shadow: 0 0 0 3px rgba(44,37,37,0.08) !important;
}

.hano-account-form__input-wrap--password {
    position: relative;
}

/* ─── BUTTONS ────────────────────────────────────────────────────────────────
   Use a scoped reset that preserves padding/sizing instead of "all: unset".
   This avoids the problem where all: unset strips padding and height.
   ─────────────────────────────────────────────────────────────────────────── */
#hano-account-app button {
    /* Scoped reset — keeps box model intact */
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: none;
    margin: 0;
    box-sizing: border-box;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 15px;
    border-radius: var(--hano-radius) !important;
    transition: background 0.15s, opacity 0.15s, border-color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    line-height: 1;
}

/* Primary — full-width, tall */
.hano-account-btn--primary {
    display: flex !important;
    width: 100%;
    height: 52px;
    padding: 0 24px !important;
    background: var(--hano-accent) !important;
    color: #ffffff !important;
    border-radius: var(--hano-radius) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin-top: 10px;
}

.hano-account-btn--primary:hover:not(:disabled) {
    background: var(--hano-accent-hover) !important;
}

.hano-account-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Outline — full-width, tall */
.hano-account-btn--outline {
    display: flex !important;
    width: 100%;
    height: 52px;
    padding: 0 24px !important;
    background: transparent !important;
    color: var(--hano-text) !important;
    border: 1.5px solid var(--hano-border) !important;
    border-radius: var(--hano-radius) !important;
    font-size: 16px !important;
    margin-top: 10px;
}

.hano-account-btn--outline:hover {
    background: var(--hano-light) !important;
}

/* Danger — small inline */
.hano-account-btn--danger {
    display: inline-flex !important;
    height: 38px;
    padding: 0 18px !important;
    background: transparent !important;
    color: #ef4444 !important;
    border: 1.5px solid #fecaca !important;
    border-radius: var(--hano-radius-sm) !important;
    font-size: 14px !important;
}

.hano-account-btn--danger:hover {
    background: #fef2f2 !important;
}

/* Password toggle — inline text button */
.hano-account-form__password-toggle {
    position: absolute !important;
    right: 14px;
    background: none !important;
    border: none !important;
    padding: 4px 8px !important;
    cursor: pointer;
    color: var(--hano-muted) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    height: auto !important;
    border-radius: 4px !important;
}

.hano-account-form__password-toggle:hover {
    color: var(--hano-text) !important;
}

/* ─── Error / Success messages ──────────────────────────────────────────────── */
.hano-account-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: var(--hano-radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 18px;
}

.hano-account-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    border-radius: var(--hano-radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 18px;
}

/* ─── Loading spinner ───────────────────────────────────────────────────────── */
.hano-account-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: hano-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.hano-account-spinner--dark {
    border-color: rgba(0,0,0,0.12);
    border-top-color: var(--hano-accent);
}

@keyframes hano-spin {
    to { transform: rotate(360deg); }
}

/* ─── Account Header ────────────────────────────────────────────────────────── */
.hano-account-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--hano-border);
}

.hano-account-header__info {
    display: flex;
    align-items: center;
    gap: 18px;
}

.hano-account-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--hano-accent);
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hano-account-header__name {
    font-size: 18px;
    font-weight: 600;
    color: var(--hano-text);
    margin: 0 0 3px;
}

.hano-account-header__email {
    font-size: 14px;
    color: var(--hano-muted);
    margin: 0;
}

/* Logout button — special small pill */
.hano-account-logout-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
    padding: 0 18px !important;
    background: transparent !important;
    border: 1.5px solid var(--hano-border) !important;
    border-radius: 20px !important;
    color: var(--hano-muted) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.hano-account-logout-btn:hover {
    background: var(--hano-light) !important;
    color: var(--hano-text) !important;
    border-color: #d1d5db !important;
}

/* ─── Tabs ──────────────────────────────────────────────────────────────────── */
.hano-account-tabs {
    display: flex;
    gap: 4px;
    background: var(--hano-light);
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 32px;
}

/* Tab buttons — explicit padding so they look right */
.hano-account-tab {
    flex: 1;
    height: 42px !important;
    padding: 0 12px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 9px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--hano-muted) !important;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.hano-account-tab:hover {
    background: rgba(255,255,255,0.7) !important;
    color: var(--hano-text) !important;
}

.hano-account-tab--active {
    background: #ffffff !important;
    color: var(--hano-text) !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 6px rgba(0,0,0,0.1) !important;
}

/* ─── Tab content area — uniform minimum height ─────────────────────────────── */
.hano-account-bookings,
.hano-account-empty,
.hano-account-profile,
.hano-account-loading {
    min-height: 340px;
}

/* ─── Booking Cards ─────────────────────────────────────────────────────────── */
.hano-account-bookings {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 340px;
}

.hano-account-booking-card {
    border: 1.5px solid var(--hano-border);
    border-radius: 14px;
    padding: 20px 22px;
    background: #ffffff;
}

.hano-account-booking-card--past {
    opacity: 0.65;
}

.hano-account-booking-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.hano-account-booking-card__service {
    font-size: 16px;
    font-weight: 600;
    color: var(--hano-text);
    margin: 0 0 2px;
}

.hano-account-booking-card__price {
    font-size: 16px;
    font-weight: 600;
    color: var(--hano-text);
    white-space: nowrap;
    margin-left: 14px;
}

.hano-account-booking-card__meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hano-account-booking-card__meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--hano-muted);
}

.hano-account-booking-card__meta-row svg {
    flex-shrink: 0;
    color: var(--hano-muted);
}

.hano-account-booking-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--hano-border);
}

.hano-account-booking-card__status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 20px;
}

.hano-account-booking-card__status--upcoming {
    background: #f0fdf4;
    color: #16a34a;
}

.hano-account-booking-card__status--past {
    background: var(--hano-light);
    color: var(--hano-muted);
}

.hano-account-booking-card__status--cancelled {
    background: #fef2f2;
    color: #dc2626;
}

.hano-account-booking-card__status--waitlist {
    background: #eff6ff;
    color: #2563eb;
}

/* ─── Empty state ───────────────────────────────────────────────────────────── */
.hano-account-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: var(--hano-muted);
    min-height: 340px;
}

.hano-account-empty__icon {
    width: 64px;
    height: 64px;
    background: var(--hano-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    color: var(--hano-muted);
}

.hano-account-empty__title {
    font-size: 17px;
    font-weight: 600;
    color: var(--hano-text);
    margin: 0 0 8px;
}

.hano-account-empty__text {
    font-size: 14px;
    color: var(--hano-muted);
    margin: 0;
}

/* ─── Konto / Profile Tab ───────────────────────────────────────────────────── */
.hano-account-profile {
    min-height: 340px;
}

.hano-account-profile__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--hano-text);
    margin: 0 0 24px;
}

/* Two-column grid */
.hano-account-profile__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
}

.hano-account-profile__grid .hano-account-form__group {
    margin-bottom: 20px;
}

/* Full-width field */
.hano-account-form__group--full {
    grid-column: 1 / -1;
}

.hano-account-profile__actions {
    display: flex;
    gap: 14px;
    margin-top: 8px;
    padding-top: 24px;
    border-top: 1px solid var(--hano-border);
}

/* Save button in profile — not full-width */
.hano-account-profile__actions .hano-account-btn--primary {
    width: auto !important;
    min-width: 180px;
    margin-top: 0;
}

/* ─── Cancel confirm modal ──────────────────────────────────────────────────── */
.hano-account-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hano-account-modal {
    background: #ffffff;
    border-radius: 20px;
    padding: 36px 32px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.hano-account-modal__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--hano-text);
    margin: 0 0 10px;
}

.hano-account-modal__text {
    font-size: 15px;
    color: var(--hano-muted);
    margin: 0 0 28px;
    line-height: 1.6;
}

.hano-account-modal__actions {
    display: flex;
    gap: 12px;
}

.hano-account-modal__actions button {
    flex: 1;
    height: 50px !important;
    margin-top: 0 !important;
}

/* ─── Loading screen ────────────────────────────────────────────────────────── */
.hano-account-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: var(--hano-muted);
    font-size: 15px;
    min-height: 340px;
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
    .hano-account-card {
        border-radius: 16px;
        padding: 24px 20px;
    }

    .hano-account-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .hano-account-profile__grid {
        grid-template-columns: 1fr;
    }

    .hano-account-form__group--full {
        grid-column: 1;
    }

    .hano-account-tab {
        font-size: 13px !important;
        padding: 0 8px !important;
    }

    .hano-account-profile__actions .hano-account-btn--primary {
        width: 100% !important;
    }
}
