/* HOM8 customer auth — matches app login/signup (not wp-login) */

.hom8-auth {
    --hom8-border: #dddddd;
    --hom8-primary: #222222;
    --hom8-text: #222222;
    --hom8-control-radius: 12px;
    --hom8-btn-radius: 999px;
    --hom8-btn-py: 16px;
    --hom8-btn-px: 24px;
    --hom8-btn-font: 16px;
    --hom8-input-py: 14px;
    --hom8-input-px: 16px;
    --hom8-input-font: 16px;
    --hom8-label-font: 14px;
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #222;
}

.hom8-auth__title {
    margin: 0 0 20px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
}

.hom8-auth__field {
    margin-bottom: 14px;
}

.hom8-auth__field label {
    display: block;
    font-size: var(--hom8-label-font, 14px);
    font-weight: 600;
    margin-bottom: 6px;
}

.hom8-auth__field label span {
    color: #e00;
}

.hom8-auth__field input,
.hom8-auth__field select,
.hom8-auth__field textarea {
    width: 100%;
    padding: var(--hom8-input-py, 14px) var(--hom8-input-px, 16px);
    border: 1px solid var(--hom8-border, #dddddd);
    border-radius: var(--hom8-control-radius, 12px);
    font-size: var(--hom8-input-font, 16px);
    font-family: inherit;
    box-sizing: border-box;
}

.hom8-auth__field input:focus,
.hom8-auth__field select:focus,
.hom8-auth__field textarea:focus {
    outline: none;
    border-color: var(--hom8-primary, #222222);
}

.hom8-auth__field.is-invalid input,
.hom8-auth__field.is-invalid select,
.hom8-auth__field.is-invalid textarea {
    border-color: #c00;
}

.hom8-auth__field-error {
    margin: 6px 0 0;
    font-size: 13px;
    color: #c00;
    line-height: 1.4;
}

.hom8-auth__phone-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
}

.hom8-auth__pw-wrap {
    position: relative;
}

.hom8-auth__pw-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    padding: 8px;
}

.hom8-auth__link {
    display: inline-block;
    margin: 4px 0 16px;
    font-size: 14px;
    font-weight: 600;
    color: #ff385c;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.hom8-auth__error {
    margin: 0 0 12px;
    font-size: 13px;
    color: #c00;
    line-height: 1.4;
}

.hom8-auth__info {
    margin: 0 0 12px;
    font-size: 14px;
    color: #444;
    line-height: 1.5;
    padding: 12px 14px;
    background: #f5f5f5;
    border-radius: 10px;
}

.hom8-auth__footer {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    font-size: 14px;
    text-align: center;
    color: #666;
}

.hom8-auth__footer a {
    color: #222;
    font-weight: 600;
}

.hom8-auth__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 8px;
    padding: var(--hom8-btn-py, 16px) var(--hom8-btn-px, 24px);
    border: none;
    border-radius: var(--hom8-btn-radius, 999px);
    background: var(--hom8-primary, #222222);
    color: #fff !important;
    font-size: var(--hom8-btn-font, 16px);
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.hom8-auth__submit:hover,
.hom8-auth__submit:focus {
    color: #fff !important;
}

.hom8-auth__submit:disabled {
    opacity: 0.55;
    cursor: wait;
}

.hom8-auth__submit.is-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    pointer-events: none;
    opacity: 0.95;
}

.hom8-auth__submit.is-loading::before {
    display: none !important;
    content: none !important;
}

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

.hom8-prof__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.hom8-prof__menu-item--action {
    cursor: pointer;
}

button.hom8-prof__avatar-btn,
button.hom8-prof__menu-item,
button.hom8-prof__panel-back {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

button.hom8-prof__avatar-btn {
    width: 64px;
    height: 64px;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
}

button.hom8-prof__avatar-btn:hover,
button.hom8-prof__avatar-btn:active,
button.hom8-prof__avatar-btn:focus,
button.hom8-prof__avatar-btn:focus-visible,
button.hom8-prof__menu-item:hover,
button.hom8-prof__menu-item:active,
button.hom8-prof__menu-item:focus,
button.hom8-prof__menu-item:focus-visible {
    background: transparent !important;
    opacity: 1 !important;
    outline: none !important;
    box-shadow: none !important;
    color: inherit;
}

button.hom8-prof__menu-item {
    width: 100%;
    border-radius: 0;
    font-size: 16px;
}

button.hom8-prof__avatar-btn:disabled {
    opacity: 1;
    color: inherit;
}

/* ── Auth modal (in-context sign in, like the iOS app) ── */
.hom8-auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 100010;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.hom8-auth-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}

.hom8-auth-modal {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    max-height: min(92vh, 720px);
    overflow: auto;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
}

.hom8-auth-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #f5f5f5;
    color: #222222 !important;
    font-size: 0;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0 !important;
    min-height: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    text-decoration: none !important;
}

.hom8-auth-modal__close:hover,
.hom8-auth-modal__close:focus {
    background: #ebebeb;
    color: #222222 !important;
}

.hom8-auth-modal__close .hom8-icon,
.hom8-auth-modal__close .bi {
    font-size: 20px;
    line-height: 1;
    display: inline-block;
    pointer-events: none;
    color: #222222 !important;
}

.hom8-auth--modal {
    max-width: none;
    margin: 0;
    padding: 28px 20px 32px;
}

.hom8-auth__inline-link {
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: #222;
    cursor: pointer;
    text-decoration: underline;
}

@media (min-width: 640px) {
    .hom8-auth-overlay {
        align-items: center;
        padding: 20px;
    }

    .hom8-auth-modal {
        border-radius: 16px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    }
}

@media (max-width: 480px) {
    .hom8-auth {
        padding: 20px 16px 32px;
    }

    .hom8-auth__title {
        font-size: 26px;
    }

    .hom8-auth__phone-row {
        grid-template-columns: 1fr;
    }

    .hom8-auth__pw-toggle {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }

    .hom8-auth-modal__close {
        top: calc(10px + env(safe-area-inset-top, 0px));
        right: calc(10px + env(safe-area-inset-right, 0px));
        width: 44px;
        height: 44px;
    }

    .hom8-auth--modal {
        padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    }
}
