/* Auth Modal Styles — ecopus Design System */

/* ─── Modal Container ─── */
.auth-modal {
  position: relative;
  width: 100%;
  min-width: 340px;
  max-width: 400px;
  padding: 32px 36px 28px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  box-shadow: none;
}

/* ─── Close Button ─── */
.auth-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  line-height: 1;
  user-select: none;
}

.auth-close-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* ─── Title ─── */
.auth-modal h3,
.auth-modal .auth-title {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px 0;
  letter-spacing: -0.3px;
}

/* ─── Subtitle ─── */
.auth-subtitle,
.auth-quote {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 24px 0;
  letter-spacing: 0.2px;
  line-height: 1.4;
}

/* ─── Form Inputs ─── */
.auth-modal .modal-control {
  margin-bottom: 12px;
}

.auth-modal .modal-control input {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 14px;
  border-radius: var(--radius-lg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--font-sans);
  text-align: left;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.auth-modal .modal-control input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.auth-modal .modal-control input:focus {
  border-color: rgba(232, 116, 67, 0.5);
  outline: none;
  box-shadow: 0 0 0 3px rgba(232, 116, 67, 0.08);
}

/* ─── Labels (for inputs with labels) ─── */
.auth-modal .modal-control label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ─── Buttons Container ─── */
.auth-modal .modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

/* ─── Primary Button ─── */
.auth-modal .btn-primary {
  width: 100%;
  padding: 13px 16px;
  background: var(--accent);
  border: 1px solid rgba(232, 116, 67, 0.3);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(232, 116, 67, 0.2);
}

.auth-modal .btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(232, 116, 67, 0.3);
  transform: translateY(-1px);
}

.auth-modal .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(232, 116, 67, 0.2);
}

.auth-modal .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─── Secondary Button ─── */
.auth-modal .btn-secondary {
  width: 100%;
  padding: 11px 16px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 13px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.auth-modal .btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

/* ─── Logout Button ─── */
.auth-modal .btn-logout {
  background: rgba(239, 83, 80, 0.15);
  border-color: rgba(239, 83, 80, 0.25);
  color: var(--error);
  box-shadow: none;
}

.auth-modal .btn-logout:hover {
  background: rgba(239, 83, 80, 0.25);
  box-shadow: 0 4px 16px rgba(239, 83, 80, 0.15);
}

/* ─── Divider ─── */
.auth-modal .auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-modal .auth-divider::before,
.auth-modal .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

/* ─── Error Message ─── */
.auth-modal .auth-error {
  background: rgba(239, 83, 80, 0.08);
  border: 1px solid rgba(239, 83, 80, 0.18);
  color: var(--error);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
  line-height: 1.4;
  animation: auth-shake 0.3s ease;
}

@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ─── Success Message ─── */
.auth-modal .auth-success {
  background: rgba(76, 175, 80, 0.08);
  border: 1px solid rgba(76, 175, 80, 0.18);
  color: var(--success);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
  line-height: 1.4;
}

/* ─── Footer (Login/Register switch) ─── */
.auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.auth-footer-text {
  font-size: 13px;
  color: var(--text-muted);
}

.auth-link-btn {
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  transition: color 0.15s ease;
  font-weight: 500;
  border: none;
  background: none;
  padding: 0;
}

.auth-link-btn:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ─── User Profile Section ─── */
.auth-modal .auth-user-info {
  text-align: center;
  padding: 16px 0 8px;
}

.auth-modal .auth-user-avatar,
.auth-modal .auth-user-avatar-icon {
  width: 64px;
  height: 64px;
  background: rgba(232, 116, 67, 0.1);
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--accent);
  border: 1px solid rgba(232, 116, 67, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.auth-modal .auth-user-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}

.auth-modal .auth-user-role {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.auth-modal .auth-user-role span {
  color: var(--info);
  font-weight: 500;
}

/* ─── Form Switching Animation ─── */
.auth-form {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.auth-form-active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.auth-form-exit {
  opacity: 0;
  transform: translateY(-6px);
}

/* ─── Logo ─── */
.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.auth-logo-img {
  width: 72px;
  height: 72px;
  border-radius: 0;
  border: none;
  background: transparent;
  padding: 0;
}

/* ─── Registration Closed ─── */
.auth-register-closed {
  text-align: center;
  padding: 16px 0;
}

.register-closed-icon {
  margin-bottom: 16px;
  opacity: 0.5;
}

.register-closed-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--warning);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.register-closed-subtext {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto;
}

/* ─── Mobile ─── */
@media (max-width: 480px) {
  .auth-modal {
    min-width: auto;
    max-width: 100%;
    padding: 24px 20px 20px;
    border-radius: var(--radius-lg);
    margin: 0 8px;
  }

  .auth-modal h3,
  .auth-modal .auth-title {
    font-size: 18px;
  }

  .auth-modal .modal-control input {
    padding: 12px 14px;
    font-size: 16px; /* prevent zoom on iOS */
  }

  .auth-modal .btn-primary {
    padding: 14px 16px;
  }
}
