/* Modal base */
.modal {
    position: fixed;
    inset: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal.hidden {
    display: none !important;
}

/* Modal overlay */
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

/* Modal content */
.modal-content {
    position: relative;
    background: #fff;
    padding: 0;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    z-index: 10000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Red Header */
.modal-header-red {
    background: #c92127;
    padding: 15px 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-title {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: white;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    opacity: 0.8;
}

/* Tabs */
.auth-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin: 0;
    padding: 0 20px;
    background: white;
}

.auth-tab {
    flex: 1;
    padding: 12px 0;
    border: none;
    background: none;
    font-size: 0.95rem;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    margin-bottom: -2px;
    font-weight: 500;
}

.auth-tab.active {
    color: #c92127;
    border-color: #c92127;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 20px;
}

.auth-form.hidden {
    display: none;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #c92127;
}

.form-group input::placeholder {
    color: #999;
}

.forgot-link {
    text-align: right;
    color: #0066ff;
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 5px;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Modal buttons - scoped to modal only to prevent affecting other site buttons */
.modal .btn {
    border: none;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 5px;
    width: 100%;
}

/* Login/Register button states - scoped to modal */
.modal .btn-login {
    background: #e0e0e0;
    color: #333;
    transition: background 0.3s ease, color 0.3s ease;
}

.modal .btn-login:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.modal .btn-login.active {
    background: #c92127;
    color: white;
    cursor: pointer;
    opacity: 1;
}

.modal .btn-login.active:hover {
    background: #a01b20;
}

.modal .btn-login.loading {
    cursor: wait;
    opacity: 0.9;
}

/* Cancel button - scoped to modal */
.modal .btn-cancel {
    background: white;
    color: #c92127;
    border: 1px solid #c92127;
}

.modal .btn-cancel:hover {
    background: #fff5f5;
}

.form-message {
    font-size: 0.85rem;
    text-align: center;
    color: red;
    min-height: 1.2em;
    margin-top: 10px;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.account-menu {
    margin-top: 15px;
    position: relative !important;
    display: inline-block !important;
    padding-bottom: 15px;
    z-index: 1000 !important;
}