/* accounts.css - Universal stylesheet for accounts & auth pages */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* Main authentication layout */
body.auth-body {
  font-family: 'Outfit', 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background Variations */
body.auth-bg-image {
  position: relative;
  background: none;
}

body.auth-bg-image::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.5)), 
              url('../images/loginbg.jpg') no-repeat center center;
  background-size: cover;
  z-index: -1;
  pointer-events: none;
}

body.auth-bg-gradient {
  background: linear-gradient(135deg, #0b0f19 0%, #111827 50%, #0b0f19 100%);
  position: relative;
  overflow: hidden;
}

body.auth-bg-gradient::before {
  content: "";
  position: absolute;
  top: -20%;
  left: -10%;
  width: 50%;
  height: 60%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

body.auth-bg-gradient::after {
  content: "";
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 50%;
  height: 60%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

/* Auth Card container */
.auth-page {
  width: 100%;
  max-width: 440px;
  padding: 24px;
  margin: auto;
  z-index: 10;
  animation: authFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-card {
  position: relative;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  padding: 45px 35px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 
              0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.18);
}

/* Brand styling */
.auth-brand {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.auth-brand span {
  color: #f59e0b; /* text-warning accent */
}

.auth-subtitle {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 30px;
}

/* Custom Floating Label structure */
.float-label {
  position: relative;
  margin-bottom: 20px;
  text-align: left;
}

.float-label input,
.float-label select,
.float-label .form-control,
.float-label .form-select {
  width: 100%;
  padding: 22px 16px 8px 16px;
  font-size: 15px;
  font-weight: 500;
  color: #1e293b;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  outline: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.float-label label {
  position: absolute;
  top: 18px;
  left: 16px;
  color: #64748b;
  font-size: 14px;
  font-weight: 400;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: left top;
}

/* Focus input states */
.float-label input:focus,
.float-label select:focus,
.float-label .form-control:focus,
.float-label .form-select:focus {
  border-color: var(--theme-accent-color, #10b981);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(var(--theme-accent-rgb, 16, 185, 129), 0.12);
}

/* Floating behavior */
.float-label input:focus ~ label,
.float-label input:not(:placeholder-shown) ~ label,
.float-label .form-control:focus ~ label,
.float-label .form-control:not(:placeholder-shown) ~ label,
.float-label select ~ label,
.float-label .form-select ~ label {
  transform: translateY(-14px) scale(0.8);
  color: var(--theme-accent-color, #10b981);
  font-weight: 600;
}

/* Style for regular labels & custom fields (e.g., file inputs, profile page fields) */
.form-field-group {
  text-align: left;
  margin-bottom: 20px;
}

.form-field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}

/* Submit/action button styling */
.auth-btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
  background: var(--theme-accent-color, #10b981);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(var(--theme-accent-rgb, 16, 185, 129), 0.25);
  transition: all 0.2s ease;
  margin-top: 10px;
}

.auth-btn:hover {
  background: var(--theme-accent-hover, #059669);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(var(--theme-accent-rgb, 16, 185, 129), 0.35);
}

.auth-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(var(--theme-accent-rgb, 16, 185, 129), 0.2);
}

/* Navigation messages */
.auth-message {
  margin-top: 25px;
  font-size: 14px;
  color: #64748b;
}

.auth-message a {
  color: var(--theme-accent-color, #10b981);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-message a:hover {
  color: var(--theme-accent-hover, #059669);
  text-decoration: underline;
}

/* Errors/Alert container */
.auth-errors {
  margin-bottom: 20px;
  text-align: left;
}

.auth-errors ul {
  padding-left: 20px;
  margin: 10px 0 0 0;
  color: #dc2626;
  font-size: 13px;
}

.auth-errors .alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
}

/* Animations */
@keyframes authFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Dashboard Profile Update Component CSS --- */
.profile-update-container {
  max-width: 650px;
  margin: 0 auto;
}

.profile-update-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 35px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.profile-update-card .float-label {
  margin-bottom: 18px;
}

.profile-update-title {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 24px;
}

/* Mobile Responsiveness Rules */
@media (max-width: 480px) {
  .auth-card {
    padding: 30px 20px;
    border-radius: 16px;
  }
  .auth-page {
    padding: 16px;
  }
  .auth-brand {
    font-size: 24px;
  }
  .auth-btn {
    padding: 12px 16px;
    font-size: 14px;
  }
}

@media (max-width: 650px) {
  .profile-update-card {
    padding: 24px 16px;
  }
}

/* --- Accounts Dark Mode Theme Overrides --- */
[data-bs-theme="dark"] body.auth-body {
  color: var(--bs-body-color, #dee2e6);
}

[data-bs-theme="dark"] .auth-card {
  background: rgba(30, 41, 59, 0.85); /* Deep slate glassmorphism */
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45), 
              0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .auth-brand {
  color: #f8fafc;
}

[data-bs-theme="dark"] .auth-subtitle {
  color: #94a3b8;
}

[data-bs-theme="dark"] .float-label input,
[data-bs-theme="dark"] .float-label select,
[data-bs-theme="dark"] .float-label .form-control,
[data-bs-theme="dark"] .float-label .form-select {
  color: #f8fafc;
  border-color: #334155;
  background: #0f172a;
}

[data-bs-theme="dark"] .float-label label {
  color: #94a3b8;
}

[data-bs-theme="dark"] .float-label input:focus,
[data-bs-theme="dark"] .float-label select:focus,
[data-bs-theme="dark"] .float-label .form-control:focus,
[data-bs-theme="dark"] .float-label .form-select:focus {
  background: #1e293b;
  border-color: var(--theme-accent-color, #10b981);
}

[data-bs-theme="dark"] .float-label input:focus ~ label,
[data-bs-theme="dark"] .float-label input:not(:placeholder-shown) ~ label,
[data-bs-theme="dark"] .float-label .form-control:focus ~ label,
[data-bs-theme="dark"] .float-label .form-control:not(:placeholder-shown) ~ label,
[data-bs-theme="dark"] .float-label select ~ label,
[data-bs-theme="dark"] .float-label .form-select ~ label {
  color: var(--theme-accent-color, #10b981);
}

[data-bs-theme="dark"] .form-field-label {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .auth-message {
  color: #94a3b8;
}

[data-bs-theme="dark"] .profile-update-card {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

[data-bs-theme="dark"] .profile-update-title {
  color: #f8fafc;
}

[data-bs-theme="dark"] .profile-update-card .position-relative[style*="background: #f8f9fa"] {
  background: #0f172a !important;
}

/* Custom form validation overrides */
.float-label input.is-invalid,
.float-label select.is-invalid,
.float-label .form-control.is-invalid,
.float-label .form-select.is-invalid,
input.is-invalid,
select.is-invalid,
textarea.is-invalid,
input[type="text"].is-invalid,
input[type="number"].is-invalid,
input[type="email"].is-invalid,
input[type="password"].is-invalid,
input[type="date"].is-invalid,
input[type="tel"].is-invalid {
  border-color: #dc3545 !important;
  outline: 1.5px solid #dc3545 !important; /* Force red outline */
}

.float-label input.is-invalid:focus,
.float-label select.is-invalid:focus,
.float-label .form-control.is-invalid:focus,
.float-label .form-select.is-invalid:focus,
input.is-invalid:focus,
select.is-invalid:focus,
textarea.is-invalid:focus,
input[type="text"].is-invalid:focus,
input[type="number"].is-invalid:focus,
input[type="email"].is-invalid:focus,
input[type="password"].is-invalid:focus,
input[type="date"].is-invalid:focus,
input[type="tel"].is-invalid:focus {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.15) !important;
}

.invalid-feedback {
  display: block !important;
  width: 100% !important;
  margin-top: 6px !important;
  font-size: 13.5px !important;
  color: #dc3545 !important;
  font-weight: 500 !important;
  text-align: left !important;
}
