/* ABAIQ Auth Pages - Shared Styles */

/* ========== MESH GRADIENT (auth-specific positions) ========== */
.mesh-gradient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.mesh-gradient-bg.light {
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 50%, #f5f5f7 100%);
}

.mesh-gradient-bg .gradient-sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  animation: floatMeshAuth 20s ease-in-out infinite;
}

.mesh-gradient-bg .sphere-1 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  top: -15%;
  right: -10%;
  animation-delay: 0s;
}

.mesh-gradient-bg .sphere-2 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #667eea 0%, #a78bfa 100%);
  bottom: -10%;
  left: -10%;
  animation-delay: -5s;
  animation-duration: 25s;
}

.mesh-gradient-bg .sphere-3 {
  width: 350px;
  height: 350px;
  background: linear-gradient(135deg, #818cf8 0%, #667eea 100%);
  top: 30%;
  left: 20%;
  animation-delay: -10s;
  animation-duration: 30s;
}

.mesh-gradient-bg .sphere-4 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, #a78bfa 0%, #667eea 100%);
  top: 10%;
  right: 25%;
  animation-delay: -15s;
  animation-duration: 22s;
}

@keyframes floatMeshAuth {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(-30px, -20px) scale(1.02); }
}

/* ========== AUTH LAYOUT ========== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}

/* ========== AUTH CARD ========== */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 2;
  animation: authCardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authCardIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ========== AUTH HEADER ========== */
.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo {
  height: 36px;
  margin-bottom: 24px;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.auth-logo:hover {
  opacity: 0.8;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  line-height: 1.3;
}

.auth-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========== FORM STYLES ========== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: 0.01em;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: var(--font-family);
  color: var(--text-dark);
  background: #ffffff;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  outline: none;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

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

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.form-input:hover:not(:focus) {
  border-color: rgba(0, 0, 0, 0.18);
}

.form-input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Password toggle */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.password-toggle:hover {
  color: var(--text-secondary);
}

/* Select dropdown */
.form-select {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: var(--font-family);
  color: var(--text-dark);
  background: #ffffff;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  outline: none;
  transition: all var(--transition-fast);
  box-sizing: border-box;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

/* ========== AUTH BUTTON ========== */
.auth-btn {
  width: 100%;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-family);
  color: #ffffff;
  background: var(--primary-gradient);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  position: relative;
  overflow: hidden;
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.35);
}

.auth-btn:active {
  transform: translateY(0);
}

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

/* Loading spinner */
.auth-btn .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ========== DIVIDER ========== */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
}

.auth-divider span {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* ========== GOOGLE BUTTON ========== */
.google-btn {
  width: 100%;
  padding: 12px;
  font-size: 0.93rem;
  font-weight: 500;
  font-family: var(--font-family);
  color: var(--text-dark);
  background: #ffffff;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.google-btn:hover {
  border-color: rgba(0, 0, 0, 0.2);
  background: #fafafa;
}

.google-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ========== ALERTS ========== */
.auth-alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
  display: none;
  animation: alertIn 0.3s ease;
}

@keyframes alertIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-alert.show {
  display: block;
}

.auth-alert.error {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.auth-alert.success {
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.15);
}

/* ========== LINKS ========== */
.auth-links {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.auth-links a:hover {
  color: var(--primary-dark);
}

.form-link {
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.form-link:hover {
  color: var(--primary-dark);
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ========== BACK TO HOME ========== */
.auth-back {
  position: absolute;
  top: 24px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  z-index: 3;
  transition: color var(--transition-fast);
}

.auth-back:hover {
  color: var(--primary);
}

.auth-back svg {
  width: 16px;
  height: 16px;
}

/* ========== POLICY NOTICE ========== */
.form-policy-notice {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 2px;
}

.form-policy-notice a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.form-policy-notice a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ========== TERMS ACCEPTANCE CHECKBOX ========== */
.form-policy-group {
  margin-top: 4px;
}

.form-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  position: relative;
}

.form-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.form-checkbox-custom {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin-top: 2px;
  position: relative;
}

.form-checkbox-custom::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform var(--transition-fast);
  position: absolute;
  top: 2px;
  left: 6px;
}

.form-checkbox:checked + .form-checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.form-checkbox:checked + .form-checkbox-custom::after {
  transform: rotate(45deg) scale(1);
}

.form-checkbox-label:hover .form-checkbox-custom {
  border-color: var(--primary);
}

.form-checkbox:focus-visible + .form-checkbox-custom {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
  border-color: var(--primary);
}

.form-checkbox-custom.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-checkbox-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.form-checkbox-text a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.form-checkbox-text a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.form-checkbox-text strong {
  color: var(--text-dark);
  font-weight: 700;
}

/* ========== PHONE VERIFICATION ========== */
.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.otp-input {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  padding: 14px 16px;
}

.otp-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(102, 126, 234, 0.06);
  border: 1px solid rgba(102, 126, 234, 0.12);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.otp-info svg {
  stroke: var(--primary);
  flex-shrink: 0;
}

.resend-btn {
  width: 100%;
  padding: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: var(--font-family);
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.resend-btn:hover {
  color: var(--primary-dark);
}

.resend-btn:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.verify-why {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 20px;
  padding: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.verify-why svg {
  stroke: var(--text-muted);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 639px) {
  .auth-card {
    padding: 28px 24px;
    border-radius: 16px;
  }

  .auth-title {
    font-size: 1.3rem;
  }

  .auth-back {
    top: 16px;
    left: 16px;
  }
}

@media (max-width: 380px) {
  .auth-card {
    padding: 24px 20px;
  }
}
