/* ============================================================
   Designrock Technologies - Authentication & My Account Styles
   Matches design palette: #0668d7, #0c3e73, #0c2448, #111827
   ============================================================ */

/* --- Header Auth Buttons --- */
.auth-nav-container {
  display: inline-flex;
  align-items: center;
}

.btn-auth-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 700;
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: all .25s ease;
  white-space: nowrap;
}

.btn-auth-trigger:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(6, 104, 215, 0.25);
}

.btn-auth-trigger i {
  font-size: 14px;
}

/* --- My Account Dropdown --- */
.my-account-menu {
  position: relative;
  display: inline-block;
}

.my-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 6px;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all .25s ease;
  font-family: inherit;
  color: var(--heading);
}

.my-account-btn:hover {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.user-avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.account-btn-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--heading);
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-caret {
  font-size: 10px;
  color: var(--text);
  transition: transform .25s ease;
}

.my-account-menu.active .account-caret {
  transform: rotate(180deg);
}

.account-dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 270px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(12, 36, 72, 0.16);
  padding: 12px 0;
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all .25s cubic-bezier(0.16, 1, 0.3, 1);
}

.my-account-menu.active .account-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.account-dropdown-header {
  padding: 10px 18px 14px;
  border-bottom: 1px solid var(--border);
}

.account-dropdown-user-name {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-dropdown-user-email {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-role-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--primary-lt);
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.account-dropdown-links {
  list-style: none;
  padding: 8px 0;
  margin: 0;
}

.account-dropdown-links li a,
.account-dropdown-links li button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dk);
  background: none;
  border: none;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  transition: all .2s;
  box-sizing: border-box;
}

.account-dropdown-links li a:hover,
.account-dropdown-links li button:hover {
  background: var(--light);
  color: var(--primary);
  padding-left: 22px;
}

.account-dropdown-links li a i,
.account-dropdown-links li button i {
  font-size: 14px;
  width: 16px;
  color: var(--text);
  transition: color .2s;
}

.account-dropdown-links li a:hover i,
.account-dropdown-links li button:hover i {
  color: var(--primary);
}

.account-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

.account-dropdown-links .logout-item button,
.account-dropdown-links .logout-item a {
  color: #ef4444;
}

.account-dropdown-links .logout-item button:hover,
.account-dropdown-links .logout-item a:hover {
  background: #fef2f2;
  color: #dc2626;
}

.account-dropdown-links .logout-item button i {
  color: #ef4444;
}

/* ============================================================
   MODAL BACKDROP & DIALOG
   ============================================================ */
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 36, 72, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}

.auth-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.auth-modal-dialog {
  background: #fff;
  width: 100%;
  max-width: 480px;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(12, 36, 72, 0.25);
  overflow: hidden;
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: transform .3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.auth-modal-backdrop.active .auth-modal-dialog {
  transform: translateY(0) scale(1);
}

/* Modal Header */
.auth-modal-header {
  padding: 24px 28px 16px;
  position: relative;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-modal-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-modal-header-brand img {
  height: 28px;
  width: auto;
}

.auth-modal-header-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--heading);
}

.auth-modal-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}

.auth-modal-close-btn:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
  transform: rotate(90deg);
}

/* Modal Tabs */
.auth-modal-tabs {
  display: flex;
  background: var(--light);
  padding: 6px;
  margin: 18px 28px 0;
  border-radius: 12px;
  gap: 6px;
}

.auth-tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  font-size: 13.5px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-tab-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Modal Body */
.auth-modal-body {
  padding: 24px 28px 30px;
  overflow-y: auto;
}

/* Forms */
.auth-form-view {
  display: none;
}

.auth-form-view.active {
  display: block;
  animation: authFadeIn .3s ease;
}

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

.auth-input-group {
  margin-bottom: 18px;
}

.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 7px;
}

.auth-label .required {
  color: #ef4444;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrapper i.auth-input-icon {
  position: absolute;
  left: 16px;
  color: #9ca3af;
  font-size: 14px;
  pointer-events: none;
  transition: color .2s;
}

.auth-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--heading);
  background: #fff;
  transition: all .2s ease;
  box-sizing: border-box;
}

.auth-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 104, 215, 0.15);
}

.auth-input:focus + .auth-input-icon,
.auth-input-wrapper:focus-within i.auth-input-icon {
  color: var(--primary);
}

.auth-pw-toggle {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
}

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

.auth-feedback-icon {
  position: absolute;
  right: 14px;
  font-size: 14px;
  display: none;
}

.auth-feedback-icon.valid {
  display: block;
  color: #10b981;
}

.auth-feedback-icon.invalid {
  display: block;
  color: #ef4444;
}

.auth-field-hint {
  font-size: 11.5px;
  color: var(--text);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-field-hint.error {
  color: #ef4444;
}

.auth-field-hint.success {
  color: #10b981;
}

/* Password strength meter */
.pw-strength-bar {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
  position: relative;
}

.pw-strength-fill {
  height: 100%;
  width: 0%;
  transition: width .3s, background-color .3s;
}

.pw-strength-fill.weak { width: 33%; background-color: #ef4444; }
.pw-strength-fill.medium { width: 66%; background-color: #f59e0b; }
.pw-strength-fill.strong { width: 100%; background-color: #10b981; }

.auth-extra-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  font-size: 13px;
}

.auth-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dk);
  cursor: pointer;
  user-select: none;
}

.auth-checkbox-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.auth-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

/* Submit Buttons */
.auth-submit-btn {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-submit-btn:hover {
  background: var(--primary-dk);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(6, 104, 215, 0.35);
}

.auth-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.auth-switch-text {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text);
}

/* Alert Notification box inside modal */
.auth-alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 18px;
  display: none;
  align-items: center;
  gap: 10px;
  animation: authFadeIn .25s ease;
}

.auth-alert.active {
  display: flex;
}

.auth-alert.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-alert.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.auth-alert i {
  font-size: 16px;
  flex-shrink: 0;
}

/* ============================================================
   MY ACCOUNT PROFILE MODAL
   ============================================================ */
.account-modal-dialog {
  max-width: 620px;
}

.account-profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  background: var(--light);
  border-radius: 14px;
  margin-bottom: 24px;
}

.account-profile-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(6, 104, 215, 0.3);
  flex-shrink: 0;
}

.account-profile-info-block h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 4px;
}

.account-profile-info-block p {
  font-size: 13px;
  color: var(--text);
  margin: 0;
}

.account-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 576px) {
  .account-grid-2 {
    grid-template-columns: 1fr;
  }
}

.account-meta-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-meta-row {
  display: flex;
  justify-content: space-between;
}

.account-meta-row strong {
  color: var(--heading);
}

/* ============================================================
   FLOATING TOAST NOTIFICATIONS
   ============================================================ */
.auth-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.auth-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(12, 36, 72, 0.18);
  border-left: 5px solid var(--primary);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--heading);
  min-width: 280px;
  max-width: 380px;
  transform: translateX(120%);
  transition: transform .35s cubic-bezier(0.16, 1, 0.3, 1), opacity .35s;
}

.auth-toast.show {
  transform: translateX(0);
}

.auth-toast.toast-success {
  border-left-color: #10b981;
}

.auth-toast.toast-success i {
  color: #10b981;
}

.auth-toast.toast-error {
  border-left-color: #ef4444;
}

.auth-toast.toast-error i {
  color: #ef4444;
}

.auth-toast.toast-info {
  border-left-color: var(--primary);
}

.auth-toast.toast-info i {
  color: var(--primary);
}

/* Tab Panes */
.account-tab-pane {
  display: none;
}

.account-tab-pane.active {
  display: block;
  animation: authFadeIn .25s ease;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .btn-auth-trigger span {
    display: none;
  }
  .btn-auth-trigger {
    padding: 8px 12px;
  }
  .account-btn-name {
    display: none;
  }
  .my-account-btn {
    padding: 4px;
  }
  .auth-modal-dialog {
    margin: 10px;
  }
}
