/* ==========================================================
   MODAL BASE STYLES - SCROLL-SAFE VERSION
   ========================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0; 
    width: 100%; height: 100%;
    background-color: rgba(5, 5, 7, 0.95);
    backdrop-filter: blur(8px);
    
    /* FIX: Allows the whole screen to scroll if the modal is too tall */
    overflow-y: auto; 
    padding: 40px 0; /* Ensures space at top and bottom on small screens */
}

.modal-content {
    position: relative;
    max-width: 450px;
    width: 90%; /* Responsive width */
    
    /* FIX: Centers the modal and provides safe vertical spacing */
    margin: 0 auto; 
    
    padding: 3rem;
    animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.close-modal {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: 0.2s;
}

.close-modal:hover { color: #fff; }

/* Tabs */
.modal-tabs {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: none; border: none;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding-bottom: 0.8rem;
    cursor: pointer;
    letter-spacing: 1px;
}

.tab-btn.active {
    color: var(--accent-blue);
    border-bottom: 2px solid var(--accent-blue);
}

/* Inputs */
.input-group { margin-bottom: 1.5rem; }
.input-group label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    margin-bottom: 0.6rem;
    color: var(--accent-blue);
    letter-spacing: 1px;
}

.input-group input {
    width: 100%;
    padding: 0.9rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: #fff;
    font-family: var(--font-sans);
    outline: none;
}

.input-group input:focus { 
    border-color: var(--accent-blue); 
    background: rgba(255, 255, 255, 0.07); 
}

/* Status Messages */
.status-msg, .reg-status-msg {
    margin-top: 1rem;
    font-size: 0.8rem;
    text-align: center;
}

/* ==========================================================
   SYSTEM DIALOGS (Themed Popups)
   ========================================================== */

.dialog-box {
    max-width: 420px;
    padding: 2.5rem !important;
    border: 1px solid var(--accent-blue);
    box-shadow: 0 0 40px rgba(0, 170, 255, 0.15);
}

.dialog-header h3 {
    font-size: 0.85rem;
    color: var(--accent-blue);
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
}

.dialog-body p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
    max-width: none;
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-dialog-cancel {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid #ff4444;
    color: #ff4444;
    font-size: 0.75rem;
    padding: 0.8rem 1.8rem;
    cursor: pointer;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.btn-dialog-cancel:hover {
    background: #ff4444;
    color: #fff;
}

/* Adjustment for standard buttons in footer/dialog */
.dialog-footer .btn {
    padding: 0.8rem 1.8rem;
    font-size: 0.75rem;
}

@media (max-width: 480px) {
    .modal-content {
        padding: 2rem 1.5rem;
    }
    .modal-tabs {
        gap: 1rem;
    }
}