/*
  styles.css
  ULO AI Authentication Styles
  Author: DesignerGPT
  Date: 2025-09-21
*/

:root {
  --primary: #ffd400;
  --dark: #222;
  --light: #fff;
  --error: #d9534f;
  --success: #28a745;
  --radius: 16px;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #f5f5f5;
  color: var(--dark);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  background: var(--light);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  max-width: 420px;
  width: 100%;
  animation: fadeIn 0.4s ease;
}

.logo {
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

h1 {
  margin: 0.5rem 0;
  font-size: 1.25rem;
}

.subtext {
  margin-bottom: 1.5rem;
  color: #666;
}

.tab-switch {
  display: flex;
  margin-bottom: 1rem;
}

.tab-switch button {
  flex: 1;
  padding: 0.75rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: bold;
}

.tab-switch button.active {
  border-bottom-color: var(--primary);
  color: var(--dark);
}

.form {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}

.form.active {
  display: flex;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"] {
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  font-size: 1rem;
}

input:focus {
  outline: 2px solid var(--primary);
}


.toggle-password {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
}

.primary-btn {
  background: var(--primary);
  border: none;
  padding: 0.75rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 0.5rem;
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}


.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.error-summary {
  color: var(--error);
  font-size: 0.85rem;
  min-height: 1rem;
}

meter {
  width: 100%;
  height: 0.5rem;
}

.footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
  color: #666;
}


@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  width: 100%;
  padding-right: 2.5rem; /* leave space for the eye button */
}

.password-field .toggle-password {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #555;
}

.password-field .toggle-password:focus {
  outline: 2px solid var(--primary);
  border-radius: 50%;
}

.logo {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.logo img {
  height: 150px;  /* adjust as needed */
  width: auto;
  border-radius: 8px; /* optional if you want rounded edges */
}

/* Alerts */
.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.alert button.close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  color: inherit;
  cursor: pointer;
  margin-left: 1rem;
}

.align-center{
  text-align: center;
.spinner {
  width: 20px;                /* bigger size */
  height: 20px;
  border: 3px solid #FFD400;  /* your primary yellow color */
  border-top: 3px solid transparent; /* top transparent for spinning effect */
  border-radius: 50%;
  display: inline-block;
  animation: spin 1s linear infinite;
  vertical-align: middle;
  margin: 0 auto;              /* center inside button */
}

.loading-text {
  vertical-align: middle;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}


/* Toasts */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

.toast {
  background: var(--dark);
  color: var(--light);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-top: 0.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  min-width: 240px;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--error);
}
#toast {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: var(--light);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#toast.show {
  opacity: 1;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1rem;
  }

  h1 {
    font-size: 1rem;
  }

  .subtext {
    font-size: 0.8rem;
  }

  .tab-switch button {
    font-size: 0.8rem;
    padding: 0.4rem;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"] {
    font-size: 0.8rem;
    padding: 0.5rem;
  }

  .primary-btn {
    font-size: 0.8rem;
    padding: 0.5rem;
  }

  .form-options {
    font-size: 0.8rem;
  }

  .footer {
    font-size: 0.75rem;
  }
}