/**
 * Hararah - Auth · storefront widget
 *
 * Scoped entirely under .hh-auth-* so it cannot leak into the theme. Palette is
 * the house concept: near-black, white, copper. No new fonts — inherits the
 * theme's family so Arabic and Latin stay consistent.
 */

.hh-auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(17, 17, 17, .72);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.hh-auth-overlay[hidden] {
    display: none;
}

body.hh-auth-open {
    overflow: hidden;
}

.hh-auth-box {
    position: relative;
    width: 100%;
    max-width: 380px;
    padding: 32px 28px 28px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
    color: #111;
    font-family: inherit;
}

.hh-auth-close {
    position: absolute;
    top: 8px;
    inset-inline-end: 10px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: none;
    color: #999;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.hh-auth-close:hover {
    color: #111;
}

.hh-auth-title {
    margin: 0 0 6px;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: .01em;
    color: #111;
}

.hh-auth-hint {
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.6;
    color: #6b6b6b;
}

.hh-auth-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid #d8d8d8;
    border-radius: 3px;
    background: #fff;
    color: #111;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.hh-auth-google:hover,
.hh-auth-google:focus-visible {
    border-color: #b87333;
    box-shadow: 0 0 0 3px rgba(184, 115, 51, .12);
    outline: none;
}

.hh-auth-google svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.hh-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: #777;
    font-size: 12px;
}

.hh-auth-divider::before,
.hh-auth-divider::after {
    content: '';
    height: 1px;
    flex: 1;
    background: #e8e8e8;
}

.hh-auth-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.hh-auth-cc {
    flex: 0 0 108px;
    min-width: 0;
}

.hh-auth-input,
.hh-auth-cc {
    height: 46px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    color: #111;
    font-family: inherit;
    font-size: 15px;
    transition: border-color .15s ease;
}

.hh-auth-input {
    display: block;
    width: 100%;
    margin-bottom: 14px;
}

.hh-auth-row .hh-auth-input {
    margin-bottom: 0;
}

.hh-auth-input:focus,
.hh-auth-cc:focus {
    outline: none;
    border-color: #b87333;
    box-shadow: 0 0 0 3px rgba(184, 115, 51, .15);
}

.hh-auth-code {
    letter-spacing: .5em;
    text-align: center;
    font-size: 22px;
    font-variant-numeric: tabular-nums;
}

.hh-auth-btn {
    display: block;
    width: 100%;
    height: 48px;
    margin-top: 4px;
    border: 0;
    border-radius: 3px;
    background: #111;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    transition: background .15s ease;
}

.hh-auth-btn:hover:not(:disabled) {
    background: #b87333;
}

.hh-auth-btn:disabled {
    opacity: .55;
    cursor: default;
}

.hh-auth-btn.is-busy {
    color: transparent;
    position: relative;
}

.hh-auth-btn.is-busy::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hh-auth-spin .7s linear infinite;
}

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

.hh-auth-error {
    margin-bottom: 12px;
    padding: 9px 11px;
    border-radius: 3px;
    background: #fdf2f2;
    color: #a02020;
    font-size: 13px;
    line-height: 1.5;
}

.hh-auth-error[hidden] {
    display: none;
}

.hh-auth-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.hh-auth-link {
    padding: 0;
    border: 0;
    background: none;
    color: #b87333;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

.hh-auth-link:disabled {
    color: #bbb;
    cursor: default;
}

.hh-auth-countdown {
    margin-top: 10px;
    min-height: 18px;
    color: #8a8a8a;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

@media (max-width: 480px) {
    .hh-auth-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .hh-auth-box {
        max-width: none;
        border-radius: 12px 12px 0 0;
        padding-bottom: 34px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hh-auth-btn.is-busy::after {
        animation-duration: 2s;
    }
}
