/* ====================================
   RivalProbe Auth Modal
   ==================================== */

.rp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.rp-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.rp-modal-card {
    background: #000000;
    border-radius: 22px;
    padding: 44px 48px 40px;
    width: 100%;
    max-width: 456px;
    position: relative;
    transform: translateY(22px) scale(0.96);
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

/* subtle neutral border */
.rp-modal-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 23px;
    background: rgba(255, 255, 255, 0.07);
    z-index: -1;
    pointer-events: none;
}

.rp-modal-overlay.is-open .rp-modal-card {
    transform: translateY(0) scale(1);
}

/* Close button */
.rp-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.45);
    transition: background 0.2s, color 0.2s, transform 0.2s;
    padding: 0;
    line-height: 1;
}

.rp-modal-close:hover {
    background: rgba(255, 255, 255, 0.13);
    color: rgba(255, 255, 255, 0.9);
    transform: rotate(90deg);
}

/* Logo */
.rp-modal-logo {
    height: 28px;
    width: auto;
    display: block;
    margin-bottom: 26px;
}

/* Headings */
.rp-modal-title {
    font-size: 23px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 6px 0;
    letter-spacing: -0.3px;
    line-height: 1.25;
}

.rp-modal-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 28px 0;
    line-height: 1.6;
}

/* Back link */
.rp-modal-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #a78bfa;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-bottom: 18px;
    transition: gap 0.18s ease;
}

.rp-modal-back:hover {
    gap: 9px;
}

/* Fields */
.rp-modal-field {
    margin-bottom: 15px;
    position: relative;
}

.rp-modal-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 7px;
    letter-spacing: 0.015em;
}

.rp-modal-field input {
    width: 100%;
    background: rgba(255, 255, 255, 0.045);
    border: 1.5px solid rgba(255, 255, 255, 0.09);
    border-radius: 11px;
    padding: 13px 16px;
    font-size: 15px;
    color: #f1f5f9;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
    font-family: inherit;
}

.rp-modal-field input:focus {
    border-color: #6C33FF;
    background: rgba(108, 51, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(108, 51, 255, 0.12);
}

.rp-modal-field input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.rp-modal-field.has-toggle input {
    padding-right: 48px;
}

/* Password toggle */
.rp-modal-pw-toggle {
    position: absolute;
    right: 13px;
    bottom: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.28);
    padding: 2px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    line-height: 1;
}

.rp-modal-pw-toggle:hover {
    color: rgba(255, 255, 255, 0.65);
}

.rp-modal-pw-toggle svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* Forgot row */
.rp-modal-forgot-row {
    text-align: right;
    margin-top: -6px;
    margin-bottom: 22px;
}

.rp-modal-forgot-row a {
    font-size: 13px;
    color: #a78bfa;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
}

.rp-modal-forgot-row a:hover {
    color: #c4b5fd;
    text-decoration: underline;
}

/* Submit button */
.rp-modal-submit {
    width: 100%;
    padding: 14px 24px;
    border-radius: 11px;
    border: none;
    background: #6C33FF;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    margin-bottom: 22px;
    letter-spacing: 0.01em;
    font-family: inherit;
    box-shadow: 0 4px 20px rgba(108, 51, 255, 0.35);
    position: relative;
    overflow: hidden;
}

.rp-modal-submit::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background 0.2s;
}

.rp-modal-submit:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 8px 30px rgba(108, 51, 255, 0.5);
}

.rp-modal-submit:hover::after {
    background: rgba(255, 255, 255, 0.07);
}

.rp-modal-submit:active {
    transform: translateY(0);
}

/* Switch link */
.rp-modal-switch {
    text-align: center;
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.rp-modal-switch a {
    color: #a78bfa;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s;
}

.rp-modal-switch a:hover {
    color: #c4b5fd;
}

/* Panel switching */
.rp-panel {
    display: none;
}

.rp-panel.is-active {
    display: block;
}

/* Success state */
.rp-modal-success {
    display: none;
    text-align: center;
    padding: 12px 0 4px;
}

.rp-modal-success.is-active {
    display: block;
}

.rp-success-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 4px 24px rgba(16, 185, 129, 0.4);
}

.rp-success-icon svg {
    width: 26px;
    height: 26px;
    color: #fff;
    display: block;
}

.rp-modal-success h3 {
    font-size: 21px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 8px 0;
}

.rp-modal-success p {
    font-size: 14px;
    color: #64748b;
    line-height: 1.7;
    margin: 0 0 26px 0;
}

/* Divider */
.rp-modal-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    margin: 20px 0;
}

/* Responsive */
@media (max-width: 520px) {
    .rp-modal-card {
        padding: 32px 22px 28px;
        border-radius: 18px;
        max-width: 100%;
    }

    .rp-modal-card::before {
        border-radius: 19px;
    }

    .rp-modal-title {
        font-size: 20px;
    }
}
