/* ──────────────────────────────────────────────────────────────
   RotoBlu Account Modal
   ────────────────────────────────────────────────────────────── */

/* Overlay */
[data-rotoblu-account-modal][hidden] { display: none; }

[data-rotoblu-account-modal] {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.rotoblu-account-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 28, 48, 0.62);
    backdrop-filter: blur(2px);
    cursor: pointer;
}

/* Card */
.rotoblu-account-modal__card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 28px 28px 24px;
    border: 1px solid #d8ebff;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(198, 231, 255, 0.52), transparent 40%),
        linear-gradient(180deg, #f8fcff 0%, #eef8ff 100%);
    box-shadow: 0 24px 64px rgba(20, 90, 165, 0.18), 0 2px 8px rgba(20, 90, 165, 0.08);
    color: #16324f;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.rotoblu-account-modal__eyebrow {
    margin: 0 0 4px;
    color: #4d8fcc;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rotoblu-account-modal__card h2 {
    margin: 0 0 18px;
    color: #0e2d4a;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.2;
}

.rotoblu-account-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #7aa7c7;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.15s;
}

.rotoblu-account-modal__close:hover,
.rotoblu-account-modal__close:focus-visible {
    background: rgba(20, 110, 190, 0.1);
    outline: 2px solid #74c0fc;
}

/* Tabs */
.rotoblu-account-tabs {
    display: flex;
    gap: 4px;
    margin: 0 0 18px;
    padding: 4px;
    border: 1px solid #d0e9fb;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
}

.rotoblu-account-tabs button {
    flex: 1;
    padding: 7px 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #2d6f9f;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.rotoblu-account-tabs button.is-active {
    background: linear-gradient(180deg, #228be6 0%, #1971c2 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(25, 113, 194, 0.25);
}

.rotoblu-account-tabs button:focus-visible {
    outline: 2px solid #74c0fc;
    outline-offset: 2px;
}

/* Message banner */
.rotoblu-account-message {
    display: none;
    margin: 0 0 14px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.rotoblu-account-message:not(:empty) { display: block; }

.rotoblu-account-message.is-success {
    border: 1px solid #b2f2bb;
    background: #ebfbee;
    color: #1a6b30;
}

.rotoblu-account-message.is-error {
    border: 1px solid #ffc9c9;
    background: #fff5f5;
    color: #c92a2a;
}

.rotoblu-account-message.is-info {
    border: 1px solid #d0ebff;
    background: #e7f5ff;
    color: #1864ab;
}

/* Forms */
.rotoblu-account-form { display: none; }
.rotoblu-account-form.is-active {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rotoblu-account-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #1a3d5c;
    font-size: 13px;
    font-weight: 800;
}

.rotoblu-account-form input[type="text"],
.rotoblu-account-form input[type="email"],
.rotoblu-account-form input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #bdddf7;
    border-radius: 12px;
    background: #f8fcff;
    color: #12384f;
    font: inherit;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.rotoblu-account-form input:focus {
    outline: none;
    border-color: #74c0fc;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(116, 192, 252, 0.22);
}

.rotoblu-account-form [type="submit"] {
    padding: 11px 16px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #228be6 0%, #1971c2 100%);
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(25, 113, 194, 0.25);
    transition: opacity 0.15s;
}

.rotoblu-account-form [type="submit"]:hover { opacity: 0.9; }
.rotoblu-account-form [type="submit"]:disabled { opacity: 0.6; cursor: default; }

.rotoblu-account-check {
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
    font-weight: 700 !important;
    cursor: pointer;
}

.rotoblu-account-check input { width: auto !important; }

.rotoblu-account-fineprint {
    margin: 0;
    color: #6a90b0;
    font-size: 12px;
    line-height: 1.5;
}

.rotoblu-account-fineprint a { color: #2080cc; }

/* Password strength indicator */
.rotoblu-account-pw-strength {
    font-size: 12px;
    font-weight: 800;
    min-height: 16px;
    transition: color 0.2s;
}

.rotoblu-account-pw-strength[data-score="0"],
.rotoblu-account-pw-strength[data-score="1"] { color: #c92a2a; }
.rotoblu-account-pw-strength[data-score="2"] { color: #e67700; }
.rotoblu-account-pw-strength[data-score="3"] { color: #2f9e44; }
.rotoblu-account-pw-strength[data-score="4"] { color: #1a6b30; }

/* Verification prompt (inline and in-modal) */
.rotoblu-account-verify-prompt {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid #d0e9fb;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    color: #1a3d5c;
    font-size: 13px;
}

.rotoblu-account-verify-prompt strong {
    display: block;
    font-size: 14px;
    font-weight: 900;
    color: #0e2d4a;
}

.rotoblu-account-verify-prompt span {
    color: #4d8fcc;
    font-weight: 600;
}

.rotoblu-account-verify-prompt button {
    align-self: flex-start;
    padding: 7px 14px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #228be6 0%, #1971c2 100%);
    color: #ffffff;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(25, 113, 194, 0.22);
}

/* Modal open trigger button (CTA in feeds/lounges) */
.rotoblu-account-open {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border: 1px solid #bdddf7;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #eef8ff 100%);
    color: #146ebe;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(32, 91, 143, 0.08);
    transition: box-shadow 0.15s;
}

.rotoblu-account-open:hover,
.rotoblu-account-open:focus-visible {
    box-shadow: 0 8px 22px rgba(32, 91, 143, 0.16);
    outline: 2px solid #74c0fc;
}

/* Account state bar */
.rotoblu-account-state {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #1a3d5c;
}

.rotoblu-account-state__logout {
    color: #4d8fcc;
    font-weight: 800;
    text-decoration: none;
}

.rotoblu-account-state__logout:hover { text-decoration: underline; }

/* Toast notification */
.rotoblu-account-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    z-index: 100001;
    padding: 12px 20px;
    border-radius: 999px;
    background: linear-gradient(180deg, #228be6 0%, #1971c2 100%);
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 8px 28px rgba(25, 113, 194, 0.32);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.rotoblu-account-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mobile */
@media (max-width: 480px) {
    [data-rotoblu-account-modal] { padding: 0; align-items: flex-end; }

    .rotoblu-account-modal__card {
        max-width: 100%;
        max-height: 90vh;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .rotoblu-account-toast { white-space: normal; max-width: calc(100vw - 32px); text-align: center; }
}
