/**
 * Storefront customer auth (login, register, forgot password modals)
 * Loaded after theme CSS so these rules take precedence.
 */

#login-modal .modal-wrapper,
#register-modal .modal-wrapper,
#forgot-password-modal .modal-wrapper {
    max-width: min(920px, calc(100vw - 24px));
    width: 100%;
}

#login-modal .modal-inner,
#register-modal .modal-inner,
#forgot-password-modal .modal-inner {
    padding: 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
}

#login-modal .modal-inner .modal-body,
#register-modal .modal-inner .modal-body,
#forgot-password-modal .modal-inner .modal-body,
#login-modal .body .modal-body,
#register-modal .body .modal-body,
#forgot-password-modal .body .modal-body {
    padding: 0 !important;
}

.store-auth-modal-body {
    overflow: hidden;
}

.store-auth-modal {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    min-height: 420px;
    background: #fff;
}

.store-auth-modal__brand {
    position: relative;
    padding: 2.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #f8fafc;
    background:
        radial-gradient(ellipse 120% 80% at 20% 0%, rgba(255, 255, 255, 0.12), transparent 55%),
        linear-gradient(155deg, #0f172a 0%, #1e293b 48%, #334155 100%);
    overflow: hidden;
}

.store-auth-modal__brand::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.06) 1px, transparent 0);
    background-size: 22px 22px;
    pointer-events: none;
    opacity: 0.7;
}

.store-auth-modal__brand-inner {
    position: relative;
    z-index: 1;
    max-width: 260px;
}

.store-auth-modal__logo {
    max-width: 120px;
    max-height: 72px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto 1.25rem;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.store-auth-modal__logo-fallback {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.store-auth-modal__store-name {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}

.store-auth-modal__tagline {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    opacity: 0.82;
}

.store-auth-modal__content {
    padding: 2rem 2.25rem 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    max-height: min(88vh, 720px);
}

.store-auth-modal__badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    margin-bottom: 0.75rem;
}

.store-auth-modal__title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.35rem, 2.5vw, 1.65rem);
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
    letter-spacing: -0.03em;
}

.store-auth-modal__subtitle {
    margin: 0 0 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #64748b;
    max-width: 36ch;
}

.store-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.store-auth-form .row {
    margin: 0;
}

.store-auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.store-auth-field label,
.store-auth-field .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    margin: 0;
}

.store-auth-field__label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.store-auth-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.store-auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.store-auth-input-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    display: flex;
    line-height: 0;
}

.store-auth-input-wrap--password .store-auth-input {
    padding-right: 2.75rem;
}

.store-auth-input,
.store-auth-field .form-control {
    width: 100%;
    min-height: 46px;
    padding: 0.65rem 0.85rem 0.65rem 2.65rem;
    font-size: 0.9375rem;
    line-height: 1.4;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    box-shadow: none;
}

.store-auth-input:focus,
.store-auth-field .form-control:focus {
    outline: none;
    border-color: #64748b;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.15);
}

.store-auth-password-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #94a3b8;
    padding: 0.4rem;
    border-radius: 8px;
    cursor: pointer;
    line-height: 0;
}

.store-auth-password-toggle:hover {
    color: #475569;
    background: #f1f5f9;
}

.store-auth-submit,
#login-modal .store-auth-submit.login-btn,
#register-modal .store-auth-submit.register-btn,
#forgot-password-modal .store-auth-submit.login-btn {
    width: 100%;
    min-height: 48px;
    margin-top: 0.25rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff !important;
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%) !important;
    border: none !important;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22);
}

.store-auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.28);
    opacity: 0.96;
}

.store-auth-link {
    color: #0f172a;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.store-auth-link:hover {
    color: #334155;
    border-bottom-color: currentColor;
}

.store-auth-link--sm {
    font-size: 0.8125rem;
    font-weight: 500;
}

.store-auth-link--back {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.store-auth-switch {
    margin: 0.75rem 0 0;
    text-align: center;
    font-size: 0.875rem;
    color: #64748b;
}

.store-auth-error {
    font-size: 0.8125rem;
    color: #dc2626;
}

.store-auth-field--phone .form-group {
    margin: 0;
}

.store-auth-field--phone .store-auth-input,
.store-auth-field--phone .form-control {
    padding-left: 2.65rem;
}

.store-auth-field--phone .text-xs {
    margin-top: 0.35rem !important;
    font-size: 0.75rem !important;
    color: #94a3b8 !important;
}

/* Hide legacy section titles if any theme injects them */
#login-modal .section-title,
#register-modal .section-title,
#forgot-password-modal .section-title {
    display: none;
}

#login-modal .login-info,
#register-modal .login-info,
#forgot-password-modal .login-info {
    display: none;
}

/* Tablet / mobile */
@media (max-width: 767px) {
    #login-modal .modal-wrapper,
    #register-modal .modal-wrapper,
    #forgot-password-modal .modal-wrapper {
        max-width: calc(100vw - 16px);
    }

    .store-auth-modal {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .store-auth-modal__brand {
        padding: 1.25rem 1rem;
        min-height: auto;
    }

    .store-auth-modal__brand-inner {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        max-width: none;
        text-align: left;
    }

    .store-auth-modal__logo,
    .store-auth-modal__logo-fallback {
        margin: 0;
        flex-shrink: 0;
    }

    .store-auth-modal__logo {
        max-width: 56px;
        max-height: 40px;
    }

    .store-auth-modal__logo-fallback {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
        border-radius: 12px;
    }

    .store-auth-modal__tagline {
        display: none;
    }

    .store-auth-modal__store-name {
        font-size: 1rem;
        margin: 0;
    }

    .store-auth-modal__content {
        padding: 1.25rem 1.15rem 1.5rem;
        max-height: none;
    }

    .store-auth-modal__subtitle {
        margin-bottom: 1.15rem;
        font-size: 0.875rem;
    }

    .store-auth-field-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 380px) {
    .store-auth-field__label-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* RTL */
[dir='rtl'] .store-auth-input-icon {
    left: auto;
    right: 0.85rem;
}

[dir='rtl'] .store-auth-input,
[dir='rtl'] .store-auth-field .form-control {
    padding: 0.65rem 2.65rem 0.65rem 0.85rem;
}

[dir='rtl'] .store-auth-input-wrap--password .store-auth-input {
    padding-left: 2.75rem;
    padding-right: 2.65rem;
}

[dir='rtl'] .store-auth-password-toggle {
    right: auto;
    left: 0.35rem;
}

[dir='rtl'] .store-auth-modal__brand-inner {
    text-align: right;
}

@media (max-width: 767px) {
    [dir='rtl'] .store-auth-modal__brand-inner {
        flex-direction: row-reverse;
    }
}

/* Standalone reset password page */
body.reset-password-page .login-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    padding: 2rem 1rem;
}

body.reset-password-page .login-form {
    max-width: 440px;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.1);
    border: 1px solid #e2e8f0;
}

body.reset-password-page .login-form .form-control {
    border-radius: 12px;
    min-height: 46px;
    border-color: #e2e8f0;
    background: #f8fafc;
}

body.reset-password-page .login-btn-2 {
    border-radius: 12px;
    min-height: 48px;
    font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Full-page storefront content (About, Terms, Privacy, Forgot, etc.) */
/* ------------------------------------------------------------------ */

.store-page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

.store-page-wrapper .store-page {
    flex: 1 0 auto;
}

.store-page-wrapper .site-footer.store-footer-extended {
    margin-top: auto;
}

.store-page__hero {
    background:
        radial-gradient(ellipse 120% 80% at 20% 0%, rgba(255, 255, 255, 0.1), transparent 55%),
        linear-gradient(155deg, #0f172a 0%, #1e293b 48%, #334155 100%);
    color: #f8fafc;
    padding: 1.25rem 0 1.5rem;
}

.store-page__hero-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.store-page__back {
    color: rgba(248, 250, 252, 0.85);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
}

.store-page__back:hover {
    color: #fff;
}

.store-page__brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.store-page__logo {
    max-width: 64px;
    max-height: 48px;
    object-fit: contain;
}

.store-page__logo-fallback {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    flex-shrink: 0;
}

.store-page__store-name {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.store-page__tagline {
    margin: 0.2rem 0 0;
    font-size: 0.8125rem;
    opacity: 0.8;
}

.store-page__main {
    max-width: 760px;
    padding: 2rem 1.15rem 3rem;
}

.store-page__badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    margin-bottom: 0.75rem;
}

.store-page__title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.store-page__subtitle {
    margin: 0 0 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #64748b;
    max-width: 42ch;
}

.store-page__body--narrow {
    max-width: 420px;
}

.store-page__body--prose .store-page-prose {
    font-size: 1rem;
    line-height: 1.75;
    color: #334155;
}

.store-page-prose p {
    margin-bottom: 1rem;
}

.store-page-prose h2,
.store-page-prose h3,
.store-page-prose h4 {
    color: #0f172a;
    margin: 1.75rem 0 0.75rem;
    font-weight: 700;
    line-height: 1.3;
}

.store-page-prose ul,
.store-page-prose ol {
    margin: 0 0 1rem 1.25rem;
    padding: 0;
}

.store-page-prose li {
    margin-bottom: 0.35rem;
}

.store-page-prose a {
    color: #0f172a;
    font-weight: 600;
}

.store-page--form .store-page__main {
    max-width: 520px;
}

.site-footer.store-footer-extended .footer-section-title-link,
.site-footer.store-footer-extended .footer-read-more {
    color: var(--white, #fff);
    text-decoration: none;
}

.site-footer.store-footer-extended .footer-section-title-link:hover,
.site-footer.store-footer-extended .footer-read-more:hover {
    opacity: 1;
    text-decoration: underline;
}

.site-footer.store-footer-extended .footer-read-more {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    opacity: 0.9;
}

@media (min-width: 768px) {
    .store-page__hero {
        padding: 1.5rem 0 1.75rem;
    }

    .store-page__main {
        padding: 2.5rem 1.5rem 4rem;
    }
}

[dir='rtl'] .store-page__brand {
    flex-direction: row-reverse;
}

[dir='rtl'] .store-page-prose ul,
[dir='rtl'] .store-page-prose ol {
    margin-right: 1.25rem;
    margin-left: 0;
}
