.auth-container {
    background: var(--bg-secondary);
    backdrop-filter: blur(3px);
    border-radius: 20px;
    padding: 40px 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0px 0px 10px 0px var(--box-shadow-color);
    animation: slideUp 0.6s ease-out;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px;
    margin-bottom: 24px;
}

.auth-header-span {
    color: var(--accent);
    font-size: 2.0em;
}

.auth-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

.toggle-password {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    opacity: 0.7;
    background: rgba(0,0,0,0.05);
}

.toggle-password:focus {
    outline: none;
    box-shadow: 0 0 0 2px #007bff;
}

#termsModal {
    position: fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.5);
    display:flex;
    align-items:center;
    justify-content:center;
    z-index:1000;
}

#terms-modal-content {
    background: #1a1825;
    color: white;
    padding:25px;
    border-radius:8px;
    max-width:450px;
}

.visible-icon {
    display: flex;
}

.visible-icon svg {
    width: 35px;
    height: 35px;
}

.auth-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-link {
    color: #0096ff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.auth-link:hover {
    color: var(--accent);
    text-shadow: 0 0 10px rgb(130 128 128 / 25%);
}

.flash-messages {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.flash-message {
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%);
    border-radius: 10px;
    color: white;
    text-align: center;
    font-weight: 500;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.input-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25) !important;
}

.input-error:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.3) !important;
}

.form-element .input-error + .toggle-password {
    top: 35%;
}

.auth-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 2px solid #e9ecef;
}

.auth-tab {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-size: 16px;
}

.auth-tab:hover {
    color: #495057;
}

.auth-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0096ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.form-element {
    position: relative;
    margin-bottom: 16px;
}

.two-fa-input-group {
    display: flex;
    gap: 12px;
    margin: 16px 0;
}

.two-fa-input-group input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px;
}

#twoFaError {
    color: #dc3545;
    margin-top: 8px;
    display: none;
}

.two-fa-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.flash-message.flash-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.flash-message.flash-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.flash-message.flash-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    padding: 4px 8px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-element {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 15px 20px;
    background: rgb(213 219 255 / 10%);
    border: 1px solid rgb(197 200 255 / 40%);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-family: system-ui;
    transition: all 0.3s ease;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.form-input:focus {
    outline: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.15) 100%);
    box-shadow: inset 0 0 10px 3px var(--box-shadow-color);
    transform: translateY(-2px);
}

.form-input:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .auth-container {
        padding: 30px 20px;
        margin: 10px;
    }

    .auth-header h2 {
        font-size: 1.7rem;
    }

    .form-input {
        padding: 12px 15px;
    }
}