/* ==========================================
   🪟 AUTH MODALS — Cadastro + Login
========================================== */

.auth-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.auth-modal-backdrop.show {
    display: flex;
    animation: authBackdropFade .25s ease-out;
}

@keyframes authBackdropFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-modal {
    background: linear-gradient(180deg, #131e3f 0%, #0a1024 100%);
    border: 1px solid rgba(45, 212, 255, 0.25);
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
    padding: 28px 26px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 100px rgba(45, 212, 255, 0.08);
    position: relative;
    animation: authModalSlideUp .35s cubic-bezier(.34, 1.56, .64, 1);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

@keyframes authModalSlideUp {
    from {
        transform: translateY(20px) scale(0.96);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #94a3c4;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    z-index: 2;
}

.auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.auth-modal-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    padding-top: 8px;
    width: 100%;
}

.auth-modal-logo img {
    max-height: 48px;
    max-width: 60%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.auth-modal-logo-text {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 36px;
    font-weight: 900;
    letter-spacing: 1.5px;
    color: #fff;
    text-shadow: 0 2px 12px rgba(45, 212, 255, 0.4);
    display: block;
    text-align: center;
    width: 100%;
}

.auth-modal-title {
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 4px;
    text-align: center;
}

.auth-modal-subtitle {
    color: #94a3c4;
    font-size: 13px;
    margin: 0 0 20px;
    text-align: center;
}

.auth-modal-alert {
    margin-bottom: 12px;
}
.auth-modal-alert:empty {
    display: none;
}

.auth-modal .form-group {
    margin-bottom: 14px;
}

.auth-modal .form-label {
    display: block;
    color: #94a3c4;
    font-size: 12px;
    margin-bottom: 6px;
    font-weight: 500;
}

.auth-modal .form-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    box-sizing: border-box;
    transition: all .15s;
}

.auth-modal .form-input:focus {
    outline: none;
    border-color: rgba(45, 212, 255, 0.5);
    background: rgba(0, 0, 0, 0.4);
}

.auth-modal .input-group {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
}

.auth-modal .input-group-prefix {
    position: static !important;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-right: none;
    border-radius: 10px 0 0 10px;
    padding: 12px 14px !important;
    color: #2dd4ff;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: auto !important;
    left: auto !important;
    z-index: auto !important;
}

.auth-modal .input-group-prefix + .form-input.has-prefix {
    border-radius: 0 10px 10px 0 !important;
    border-left: none;
    padding-left: 14px !important;
    flex: 1;
    min-width: 0;
}

.auth-modal .input-group .form-input {
    flex: 1;
    min-width: 0;
}

/* Quando tem botão olho de senha, dá espaço à direita */
.auth-modal .input-group:has(.input-toggle) .form-input {
    padding-right: 44px !important;
}

.auth-modal .input-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    color: #94a3c4;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    transition: color .15s;
    z-index: 2;
}

.auth-modal .input-toggle:hover {
    color: #2dd4ff;
}

.auth-modal .field-error {
    display: none;
    color: #ef4444;
    font-size: 11px;
    margin-top: 4px;
}

.auth-modal .form-group.has-error .form-input {
    border-color: rgba(239, 68, 68, 0.5);
}

.auth-modal .form-group.has-error .field-error {
    display: block;
}

.auth-modal .checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: #94a3c4;
    line-height: 1.4;
}

.auth-modal .checkbox input[type="checkbox"] {
    display: none;
}

.auth-modal .checkbox-box {
    width: 18px;
    height: 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    transition: all .15s;
    margin-top: 1px;
}

.auth-modal .checkbox input[type="checkbox"]:checked + .checkbox-box {
    background: #2dd4ff;
    border-color: #2dd4ff;
}

.auth-modal .checkbox input[type="checkbox"]:checked + .checkbox-box::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #0a1024;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.auth-modal .checkbox a {
    color: #2dd4ff;
    text-decoration: none;
}

.auth-modal .checkbox a:hover {
    text-decoration: underline;
}

.auth-modal .flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-modal .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: all .2s;
    text-decoration: none;
    box-sizing: border-box;
}

.auth-modal .btn-primary {
    background: linear-gradient(135deg, #2dd4ff, #6ee7ff);
    color: #002d3d;
    box-shadow: 0 8px 24px rgba(45, 212, 255, 0.35);
}

.auth-modal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(45, 212, 255, 0.5);
}

.auth-modal .btn-block {
    width: 100%;
}

.auth-modal .btn-lg {
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.auth-modal-switch {
    color: #5a6890;
    font-size: 12px;
    margin: 14px 0 0;
    text-align: center;
}

.auth-modal-switch a {
    color: #2dd4ff;
    text-decoration: none;
}

.auth-modal-switch a:hover {
    text-decoration: underline;
}

.auth-modal-refcode {
    background: linear-gradient(135deg, rgba(255,200,61,0.12), rgba(255,200,61,0.04));
    border: 1px solid rgba(255,200,61,0.3);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #94a3c4;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-modal-refcode strong {
    color: #ffc83d;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.auth-modal-alert .alert {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 8px;
}

.auth-modal-alert .alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.auth-modal-alert .alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.auth-modal .strength-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}

.auth-modal .strength-bar > div {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e);
    transition: width .3s, opacity .3s;
}

.mt-2 { margin-top: 12px; }
.mb-2 { margin-bottom: 12px; }

/* Body lock quando modal aberto */
body.auth-modal-open {
    overflow: hidden;
}

@media (max-width: 480px) {
    .auth-modal {
        padding: 24px 20px;
        border-radius: 16px;
    }
    .auth-modal-title {
        font-size: 20px;
    }
}
