/* Shared Auth Styles - Login, Register, Forgot Password
   Custom mobile look with thin formal inputs and proper card border */

/* ========== APPLIES TO: Login, Register, Forgot Password, Reset Password ========== */

.auth-container, .register-container, .login-container, .forgot-container, .reset-container {
  min-height: calc(100vh - 80px);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 4rem;
  position: relative;
  margin: -2rem -15px 0 -15px;
}

.auth-container::before, .register-container::before, .login-container::before,
.forgot-container::before, .reset-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%233b82f6" stroke-width="0.5" opacity="0.2"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.9;
}

.auth-container::after, .register-container::after, .login-container::after,
.forgot-container::after, .reset-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../LPHS2.png');
  background-repeat: repeat;
  background-size: 110px 110px;
  background-position: center center;
  opacity: 0.095;
  filter: grayscale(0.7) saturate(0.8);
  pointer-events: none;
}

/* Apply card border to ALL auth cards: .auth-card, .register-card, .login-card, .forgot-card */
.auth-card,
.register-card,
.login-card,
.forgot-card,
.reset-card {
  background: rgba(30, 64, 175, 0.95) !important;
  backdrop-filter: blur(25px);
  border: 2px solid rgba(251, 191, 36, 0.6) !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), 0 0 0 4px rgba(251, 191, 36, 0.15), 0 0 0 1px rgba(59, 130, 246, 0.3) !important;
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.auth-card::before, .register-card::before, .login-card::before,
.forgot-card::before, .reset-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b, #ea580c);
  z-index: 2;
}

/* Slim, formal inputs - apply to all auth forms */
.form-control, .form-select,
input[type="text"], input[type="password"], input[type="email"],
input[type="tel"], input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 0.5rem 0.875rem !important;
  font-size: 0.92rem;
  background: #ffffff !important;
  color: #1e293b;
  font-weight: 400;
  height: 42px;
  line-height: 1.4;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
  box-sizing: border-box;
}

input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus,
input[type="tel"]:focus, input[type="date"]:focus, input[type="number"]:focus,
select:focus, textarea:focus, .form-control:focus, .form-select:focus {
  outline: none;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
  background: white !important;
}

input::placeholder, textarea::placeholder { color: #94a3b8; font-weight: 400; }

.alert {
  border: 1px solid; border-radius: 8px;
  padding: 0.5rem 0.875rem; margin-bottom: 0.875rem; font-size: 0.82rem;
}
.alert-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.alert-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

.auth-submit,
.register-btn, .login-btn, .forgot-btn, .reset-btn,
button[type="submit"] {
  width: 100%; padding: 0.625rem 1rem;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #ea580c 100%) !important;
  border: none; border-radius: 8px !important; color: white !important; font-weight: 700;
  font-size: 0.9rem; letter-spacing: 0.025em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative; overflow: hidden; height: 42px;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 14px rgba(251, 191, 36, 0.35);
}
.auth-submit:hover, .register-btn:hover, .login-btn:hover, .forgot-btn:hover, .reset-btn:hover {
  transform: translateY(-1px); box-shadow: 0 6px 20px rgba(251, 191, 36, 0.5);
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 50%, #dc2626 100%) !important;
}
.auth-submit:active, .register-btn:active, .login-btn:active, .forgot-btn:active, .reset-btn:active { transform: translateY(0); }

@media (max-width: 767.98px) {
  .auth-container, .register-container, .login-container, .forgot-container, .reset-container {
    padding: 1.5rem 0.75rem 3rem; margin: -2rem -15px 0 -15px;
  }
  .auth-card, .register-card, .login-card, .forgot-card, .reset-card {
    max-width: 400px; border-radius: 14px !important;
  }
  .form-control, .form-select,
  input[type="text"], input[type="password"], input[type="email"],
  input[type="tel"], input[type="date"], input[type="number"], select, textarea {
    font-size: 16px; height: 40px; padding: 0.45rem 0.75rem !important;
  }
  .auth-submit, .register-btn, .login-btn, .forgot-btn, .reset-btn {
    font-size: 0.85rem; height: 40px;
  }
  .alert { padding: 0.45rem 0.7rem; font-size: 0.78rem; }
}

@media (max-width: 480px) {
  .auth-container, .register-container, .login-container, .forgot-container, .reset-container {
    padding: 1rem 0.5rem 2rem;
  }
  .auth-card, .register-card, .login-card, .forgot-card, .reset-card {
    border-radius: 12px !important; max-width: 100%;
  }
  .form-control, .form-select,
  input[type="text"], input[type="password"], input[type="email"],
  select, textarea { height: 38px; padding: 0.4rem 0.6rem !important; }
  .auth-submit, .register-btn, .login-btn, .forgot-btn, .reset-btn {
    height: 38px; font-size: 0.8rem; padding: 0.45rem 0.75rem;
  }
}

@media (max-width: 359px) {
  .auth-card, .register-card, .login-card, .forgot-card, .reset-card {
    border-radius: 10px !important;
  }
}
/* ===== MOBILE CRITICAL FIXES ===== */

/* Fix password toggle button clickability on mobile */
.password-input-wrapper,
.register-form .position-relative {
  position: relative !important;
}

.password-toggle-btn {
  position: absolute !important;
  right: 4px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  border: none !important;
  background: none !important;
  color: #6b7280 !important;
  z-index: 5 !important;
  padding: 0 !important;
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: transparent !important;
  border-radius: 6px !important;
  min-width: 36px !important;
  min-height: 36px !important;
}

.password-toggle-btn:hover, .password-toggle-btn:active {
  background: rgba(107, 114, 128, 0.1) !important;
  color: #3b82f6 !important;
}

.password-input-wrapper .custom-field,
.register-form input[type="password"],
.register-form input[id^="password"] {
  padding-right: 44px !important;
}

/* Fix submit buttons on mobile - ensure they're tappable */
.login-btn, .register-btn, .forgot-btn, .reset-btn,
button[type="submit"].login-btn,
button[type="submit"].register-btn {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

/* Fix input focus states on mobile - prevent zoom on iOS */
@media (max-width: 767.98px) {
  input[type="text"], input[type="password"], input[type="email"],
  input[type="tel"], input[type="date"], input[type="number"],
  select, textarea, .form-control, .form-select {
    font-size: 16px !important;
  }
}

/* Extra small phones (<360px) fix */
@media (max-width: 359px) {
  .custom-input-group {
    margin-bottom: 0.5rem;
  }
  .custom-input-group .custom-field {
    padding-left: 1.75rem !important;
    padding-right: 30px !important;
    height: 36px;
    font-size: 16px;
  }
  .custom-input-group .input-icon {
    left: 8px;
    font-size: 0.75rem;
  }
  .password-toggle-btn {
    width: 26px !important;
    height: 26px !important;
    right: 2px !important;
    min-width: 26px !important;
    min-height: 26px !important;
  }
  .password-input-wrapper .custom-field {
    padding-right: 30px !important;
  }
  .login-btn, .register-btn {
    height: 34px;
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
    margin-bottom: 0.5rem;
    min-height: 34px;
  }
  .login-form, .register-form {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
  .register-section {
    margin-left: -0.75rem !important;
    margin-right: -0.75rem !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
}

/* Landscape orientation on very small screens */
@media (max-height: 500px) and (orientation: landscape) {
  .login-container, .register-container, .forgot-container {
    min-height: auto !important;
    padding: 0.75rem 0.5rem 1rem !important;
  }
  .login-card, .register-card, .forgot-card {
    max-width: 360px;
  }
  .login-header, .register-header {
    padding: 0.75rem 0.75rem 0.5rem !important;
  }
  .login-logo, .register-logo {
    width: 36px !important;
    height: 36px !important;
    margin-bottom: 0.25rem !important;
  }
  .login-title, .register-title {
    font-size: 0.9rem !important;
    margin-bottom: 0.15rem !important;
  }
  .login-subtitle, .register-subtitle {
    font-size: 0.65rem !important;
  }
  .login-form, .register-form {
    padding: 0.5rem 0.75rem 0.75rem !important;
  }
  .form-control, .custom-field,
  input[type="text"], input[type="password"], input[type="email"],
  select {
    height: 30px !important;
    font-size: 16px !important;
    padding: 0.25rem 0.5rem !important;
  }
  .custom-input-group .custom-field {
    padding-left: 1.75rem !important;
  }
  .custom-input-group {
    margin-bottom: 0.35rem;
  }
  .remember-section {
    margin-bottom: 0.25rem !important;
    margin-top: 0 !important;
  }
  .login-btn, .register-btn {
    height: 30px !important;
    font-size: 0.7rem !important;
    padding: 0.2rem 0.5rem !important;
    margin-bottom: 0.25rem !important;
    min-height: 30px !important;
  }
  .register-section {
    padding-top: 0.35rem !important;
    padding-bottom: 0.5rem !important;
    margin-left: -0.75rem !important;
    margin-right: -0.75rem !important;
  }
  .register-text {
    font-size: 0.65rem !important;
  }
  .alert {
    padding: 0.25rem 0.5rem !important;
    margin-bottom: 0.35rem !important;
    font-size: 0.65rem !important;
  }
}

/* Fix form spacing on mobile */
@media (max-width: 575.98px) {
  .custom-input-group {
    margin-bottom: 0.5rem;
  }
  .remember-section {
    margin-bottom: 0.75rem !important;
    margin-top: 0 !important;
  }
}
