/* Authentication Styles */
.auth-modal-container {
    position: fixed;
    inset: 0;
    background: var(--shadow-darker);
    backdrop-filter: blur(15px) saturate(150%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease, backdrop-filter 0.35s ease;
    padding: 24px;
}

.auth-modal-container.visible {
    opacity: 1;
    visibility: visible;
}

.auth-modal {
    width: 400px;
    background: var(--bg-glass);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    box-shadow: 0 0 35px var(--shadow-darker);
    padding: 2rem;
    position: relative;
    color: var(--text-primary);
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    animation: modalFadeIn 0.45s cubic-bezier(0.22, 1.61, 0.36, 1) forwards;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--border-primary);
    outline: none;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.auth-btn {
    background: var(--gradient-primary);
    color: var(--text-primary);
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-primary);
}

.auth-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
}

.auth-separator::before,
.auth-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-light);
}

.auth-separator span {
    padding: 0 10px;
    font-size: 0.9rem;
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    margin-left: 5px;
}

.auth-switch a:hover {
    text-decoration: underline;
}
.form-error {
    color: #ff4444;
    font-size: 0.85rem;
    margin-top: 0.3rem;
    display: none;
}

.form-group.error input {
    border-color: #ff4444;
}

.form-group.error .form-error {
    display: block;
}

/* User Modal Styles */
.user-profile {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
}

.user-info {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    transition: background-color 0.3s ease;
}

.user-info p {
    margin: 0.75rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

#logoutBtn {
    background: var(--gradient-danger, linear-gradient(45deg, #ff4444, #ff6b6b));
    width: 100%;
    margin-top: 1rem;
    padding: 12px;
    border-radius: 12px;
    border: none;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#logoutBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 68, 68, 0.3);
}

/* Ensure user modal follows same animation */
#userModal .auth-modal {
    animation: modalFadeIn 0.45s cubic-bezier(0.22, 1.61, 0.36, 1) forwards;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 0.9rem;
    z-index: 10000;
    animation: toastSlideIn 0.3s ease forwards;
    box-shadow: 0 5px 15px var(--shadow-darker);
}

.toast.success {
    border-left: 4px solid #4CAF50;
}

.toast.error {
    border-left: 4px solid #ff4444;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .auth-modal {
        width: 100%;
        max-width: 350px;
        padding: 1.5rem;
    }

    .auth-header h2 {
        font-size: 1.5rem;
    }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.password-group {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 14px;
  top: 25px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  padding: 0;
  transition: color 0.2s ease;
}

.toggle-password:hover {
  color: #f97416b9; /* orange accent */
}

/* icon animation */
.toggle-password i {
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.toggle-password.active i {
  transform: rotate(180deg) scale(1.1);
}
