/* TVTstudy quick login/registration modal — self-contained styles so the modal
   works on any page (frontpage, storefront, React) without depending on the
   Modern Commerce bundle being loaded. */

.tvtauth-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(2px);
}

.tvtauth-modal {
    position: relative;
    width: 100%;
    max-width: 400px;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(17, 24, 39, 0.28);
    overflow: hidden;
}

.tvtauth-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 0;
}

.tvtauth-modal__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
}

.tvtauth-modal__close {
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
}

.tvtauth-modal__close:hover {
    background: #f3f4f6;
    color: #111827;
}

.tvtauth-modal__body {
    padding: 16px 20px 24px;
    overflow-y: auto;
}

/* Tabs */
.tvtauth-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    padding: 4px;
    background: #f3f4f6;
    border-radius: 12px;
}

.tvtauth-tab {
    flex: 1;
    padding: 8px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.tvtauth-tab--active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.12);
}

/* Google button */
.tvtauth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #ffffff;
    color: #1f2937;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.tvtauth-google-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.tvtauth-google-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.tvtauth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: #9ca3af;
    font-size: 0.8125rem;
}

.tvtauth-divider::before,
.tvtauth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* Form */
.tvtauth-field {
    margin-bottom: 14px;
}

.tvtauth-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
}

.tvtauth-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.9375rem;
    color: #111827;
    background: #ffffff;
}

.tvtauth-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.tvtauth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tvtauth-submit {
    width: 100%;
    margin-top: 6px;
    padding: 12px 16px;
    border: 0;
    border-radius: 10px;
    background: #2563eb;
    color: #ffffff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.tvtauth-submit:hover {
    background: #1d4ed8;
}

.tvtauth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tvtauth-submit--google {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #d1d5db;
    margin-top: 0;
}

.tvtauth-link {
    display: block;
    margin-top: 12px;
    text-align: center;
    font-size: 0.8125rem;
    color: #2563eb;
    background: none;
    border: 0;
    cursor: pointer;
}

.tvtauth-link:hover {
    text-decoration: underline;
}

.tvtauth-forgot {
    display: block;
    margin: 8px 0 0 auto;
    padding: 0;
    border: 0;
    background: none;
    text-align: right;
    font-size: 0.8125rem;
    color: #2563eb;
    text-decoration: none;
    cursor: pointer;
}

.tvtauth-forgot:hover {
    text-decoration: underline;
}

.tvtauth-forgot-intro {
    margin: 0 0 14px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #4b5563;
}

.tvtauth-message {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.875rem;
}

.tvtauth-message--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.tvtauth-message--success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.tvtauth-message__list {
    margin: 0;
    padding: 0 0 0 18px;
}

.tvtauth-message__list li {
    margin: 2px 0;
}

/* Success panel (post-signup, no redirect) */
.tvtauth-success {
    text-align: center;
    padding: 16px 8px 4px;
}

.tvtauth-success__icon {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 12px;
}

.tvtauth-success__title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

.tvtauth-success__text {
    font-size: 0.875rem;
    color: #4b5563;
}

/* While the modal is open: lock the page scroll and release the theme's fixed
   topbar so it does not float above the backdrop. The body class is toggled by
   the React component. */
body.tvtauth-locked {
    overflow: hidden;
}

body.tvtauth-locked .rui-topbar-wrapper {
    position: static !important;
    z-index: auto !important;
}

body.tvtauth-locked #back-to-top {
    display: none !important;
}
