/* Modal overlay and container */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-container {
    background: #0b0b0d;
    border-radius: 16px !important;
    padding: 0;
    max-width: 800px;
    max-height: 90vh;
    min-height: 150px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
}

.modal-overlay.show .modal-container {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 32px;
    font-weight: 300;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1;
    transition: background 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.24);
}

.modal-close:active {
    transform: scale(0.95);
}

.modal-container .modal-content {
    padding: 40px !important;
    overflow-y: auto;
    max-height: 90vh;
    color: #e2e8f0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
}

/* Auth Modal */
.modal-container#auth-modal {
    max-width: 400px !important;
    width: 70% !important;
    min-width: 320px;
}

.auth-modal-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-modal-logo-img {
    max-width: 100%;
    height: auto;
    max-height: 60px;
    object-fit: contain;
}

.auth-error {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #f87171;
    min-height: 1.25em;
}

.auth-error.auth-success {
    color: #4ade80;
}

#auth-modal .login-modal-content {
    width: 100%;
}

#auth-modal .login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#auth-modal .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#auth-modal .form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #d5d9e0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#auth-modal .form-group input {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, background-color 0.2s;
}

#auth-modal .form-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

#auth-modal .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#auth-modal .password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#auth-modal .password-input-wrapper input {
    width: 100%;
    padding-right: 2.75rem;
}

#auth-modal .password-reveal-btn {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
}

#auth-modal .password-reveal-btn:hover,
#auth-modal .password-reveal-btn.is-active {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.08);
}

#auth-modal .password-reveal-icon {
    width: 1.125rem;
    height: 1.125rem;
}

#auth-modal .form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

#auth-modal .btn-primary,
#auth-modal .btn-secondary {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-family: inherit;
}

#auth-modal .btn-primary {
    background: #6330a3;
    color: #fff;
}

#auth-modal .btn-primary:hover {
    background: #7a3dc4;
}

#auth-modal .btn-primary:active {
    transform: scale(0.98);
}

#auth-modal .btn-primary:disabled,
#auth-modal .btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#auth-modal .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

#auth-modal .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

#auth-modal .btn-secondary:active {
    transform: scale(0.98);
}
