/* ==========================================================================
   EasyTax User Authentication (Login & Forgot Password) Styles
   ========================================================================== */

:root {
  --login-brand-green: #28aa4a;
  --login-brand-green-hover: #229440;
  --login-brand-green-active: #1e8238;
}

body {
  margin: 0;
  padding: 0;
  background-color: #0b0f19;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.et-login-wrapper {
  width: 100%;
  max-width: 1200px;
  padding: 24px 16px;
  box-sizing: border-box;
  margin: 0 auto;
}

.et-login-card {
  display: flex;
  background-color: #1a2235;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  min-height: 680px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Left Grid Panel (Trust & Rating) */
.et-login-left {
  flex: 1;
  padding: 30px;
  box-sizing: border-box;
  background-color: #131a29;
  transition: background-color 0.25s ease;
}

.et-login-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 15px;
  height: 100%;
}

.et-login-grid-item {
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
}

.et-login-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.et-login-grid-item:not(.text-block) {
  padding: 0;
}

.text-block h2 {
  font-size: 2.4rem;
  font-weight: 800;
  margin: 0 0 8px;
  color: #fff;
  letter-spacing: -0.5px;
}

.text-block p {
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0;
  color: #d1d5db;
}

.dark-block {
  background-color: #0f1423;
}

.green-block {
  background-color: #28aa4a;
}

.green-block p {
  color: #e5ffe5;
}

.green-block .stars {
  color: #fbbf24;
  font-size: 1.2rem;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

/* Right Form Panel */
.et-login-right {
  flex: 0 0 460px;
  background-color: #212a40;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 44px 40px;
  box-sizing: border-box;
  transition: background-color 0.25s ease;
}

/* Top-Right Theme Toggle */
.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #2a344a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #9ca3af;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  outline: none;
}

.theme-toggle:hover {
  background: #374151;
  color: #ffffff;
  transform: scale(1.06);
}

.theme-toggle:active {
  transform: scale(0.96);
}

.theme-toggle svg {
  pointer-events: none;
}

/* Form Container */
.login-form-container {
  width: 100%;
  max-width: 360px;
}

.login-logo {
  text-align: center;
  margin-bottom: 20px;
}

.login-logo a,
.login-logo .login-logo-link {
  display: inline-block;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  outline: none;
}

.login-logo a:hover,
.login-logo .login-logo-link:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.login-logo img {
  max-width: 140px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.login-logo .logo-dark {
  display: none;
}

.login-logo .logo-light {
  display: block;
}

html.dark-theme .login-logo .logo-dark,
body.dark-theme .login-logo .logo-dark {
  display: block;
}

html.dark-theme .login-logo .logo-light,
body.dark-theme .login-logo .logo-light {
  display: none;
}

html:not(.dark-theme) .login-logo .logo-dark,
html.light-theme .login-logo .logo-dark,
body.light-theme .login-logo .logo-dark {
  display: none;
}

html:not(.dark-theme) .login-logo .logo-light,
html.light-theme .login-logo .logo-light,
body.light-theme .login-logo .logo-light {
  display: block;
}

.login-form-container h1 {
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 6px;
  color: #fff;
  letter-spacing: -0.3px;
}

.login-form-container .subtitle {
  text-align: center;
  color: #9ca3af;
  font-size: 0.9rem;
  margin: 0 0 24px 0;
  line-height: 1.4;
}

/* Green Headings & Accents */
.auth-green-heading,
.green-heading,
.text-green {
  color: #28aa4a !important;
}

/* ==========================================================================
   Drupal System Messages & Alerts (High-Visibility Alert Banners)
   ========================================================================== */
.visually-hidden {
  position: absolute !important;
  overflow: hidden !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  width: 1px !important;
  height: 1px !important;
  word-wrap: normal !important;
}

[data-drupal-messages] {
  margin-bottom: 20px;
  width: 100%;
}

/* Drupal messages wrapper & common alert styling */
[data-drupal-messages] [role="contentinfo"],
.messages {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
  box-sizing: border-box;
  animation: etSlideDownAlert 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Error Message (Red Alert) */
[data-drupal-messages] [role="contentinfo"][aria-label="Error message"],
[data-drupal-messages] > [role="alert"],
.messages--error {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-left: 5px solid #ef4444;
  color: #fca5a5;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

[data-drupal-messages] [role="contentinfo"][aria-label="Error message"]::before,
[data-drupal-messages] > [role="alert"]::before,
.messages--error::before {
  content: "";
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2'%3E%3C/polygon%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
}

/* Flatten nested role="alert" inside role="contentinfo" */
[data-drupal-messages] [role="contentinfo"] [role="alert"] {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  color: inherit !important;
  flex: 1;
}

[data-drupal-messages] [role="contentinfo"][aria-label="Error message"] a,
[data-drupal-messages] [role="alert"] a,
.messages--error a {
  color: #f87171;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

[data-drupal-messages] [role="contentinfo"][aria-label="Error message"] a:hover,
[data-drupal-messages] [role="alert"] a:hover,
.messages--error a:hover {
  color: #ffffff;
}

.messages__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.messages__item + .messages__item {
  margin-top: 6px;
}

/* Status / Success Message (Brand Green #28aa4a) */
[data-drupal-messages] [role="contentinfo"][aria-label="Status message"],
.messages--status {
  background-color: rgba(40, 170, 74, 0.14);
  border: 1px solid rgba(40, 170, 74, 0.4);
  border-left: 5px solid #28aa4a;
  color: #86efac;
  box-shadow: 0 4px 12px rgba(40, 170, 74, 0.12);
}

[data-drupal-messages] [role="contentinfo"][aria-label="Status message"]::before,
.messages--status::before {
  content: "";
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2328aa4a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'%3E%3C/path%3E%3Cpolyline points='22 4 12 14.01 9 11.01'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-drupal-messages] [role="contentinfo"][aria-label="Status message"] a,
.messages--status a {
  color: #28aa4a;
  font-weight: 600;
  text-decoration: underline;
}

/* Warning Message (Amber Banner) */
.messages--warning {
  background-color: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-left: 5px solid #f59e0b;
  color: #fcd34d;
}

/* Field Error Styling */
.form-item input.error,
.form-item input[aria-invalid="true"] {
  border-color: #ef4444 !important;
  background-color: rgba(239, 68, 68, 0.06) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22) !important;
}

.form-item--error-message {
  color: #fca5a5;
  font-size: 0.82rem;
  margin-top: 4px;
}

/* ==========================================================================
   Form Controls & Elements
   ========================================================================== */
.login-drupal-form form,
.pass-drupal-form form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-drupal-form .form-item,
.pass-drupal-form .form-item {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
}

.login-drupal-form label,
.pass-drupal-form label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e5e7eb;
}

.login-drupal-form input[type="text"],
.login-drupal-form input[type="password"],
.login-drupal-form input[type="email"],
.pass-drupal-form input[type="text"],
.pass-drupal-form input[type="email"] {
  width: 100%;
  background-color: #2a344a;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  font-size: 0.95rem;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.login-drupal-form input[type="text"]:focus,
.login-drupal-form input[type="password"]:focus,
.login-drupal-form input[type="email"]:focus,
.pass-drupal-form input[type="text"]:focus,
.pass-drupal-form input[type="email"]:focus {
  border-color: #28aa4a !important;
  box-shadow: 0 0 0 3px rgba(40, 170, 74, 0.25) !important;
  background-color: #2d3850;
}

/* Hide browser default password reveal button (Edge/IE) */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Password wrapper & Eye Toggle Button */
.login-drupal-form .form-item-pass,
.pass-drupal-form .form-item-pass,
.form-item-pass {
  position: relative !important;
}

.et-pass-input-wrapper {
  position: relative !important;
  width: 100% !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
  box-sizing: border-box !important;
}

.et-pass-input-wrapper input[type="password"],
.et-pass-input-wrapper input[type="text"],
.login-drupal-form .et-pass-input-wrapper input,
.login-drupal-form .form-item-pass input {
  margin: 0 !important;
  width: 100% !important;
  padding-right: 50px !important;
  box-sizing: border-box !important;
}

.et-password-toggle-btn {
  position: absolute !important;
  right: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 32px !important;
  height: 32px !important;
  cursor: pointer !important;
  color: #9ca3af !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
  transition: color 0.15s ease, background-color 0.15s ease !important;
  z-index: 10 !important;
  outline: none !important;
  box-shadow: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.et-password-toggle-btn:hover {
  color: #28aa4a !important;
  background-color: rgba(40, 170, 74, 0.12) !important;
}

.et-password-toggle-btn:focus-visible {
  box-shadow: 0 0 0 2px rgba(40, 170, 74, 0.4) !important;
}

.et-password-toggle-btn svg {
  width: 18px !important;
  height: 18px !important;
  stroke: currentColor !important;
  flex-shrink: 0 !important;
  margin: auto !important;
}

.et-password-toggle-btn svg.icon-eye-off {
  display: none !important;
}

.et-password-toggle-btn svg[style*="display: none"],
.et-password-toggle-btn svg[style*="display:none"],
.et-password-toggle-btn svg.is-hidden {
  display: none !important;
}

.et-password-toggle-text {
  display: none !important;
}

/* Light Theme toggle button adjustments */
html:not(.dark-theme) .et-password-toggle-btn,
html.light-theme .et-password-toggle-btn,
body.light-theme .et-password-toggle-btn {
  color: #64748b !important;
}

html:not(.dark-theme) .et-password-toggle-btn:hover,
html.light-theme .et-password-toggle-btn:hover,
body.light-theme .et-password-toggle-btn:hover {
  color: #28aa4a !important;
  background-color: rgba(40, 170, 74, 0.08) !important;
}

/* Fallback if button is placed directly inside .form-item-pass */
.form-item-pass > .et-password-toggle-btn {
  position: absolute !important;
  right: 14px !important;
  top: auto !important;
  bottom: 13px !important;
  transform: none !important;
}

/* Password reset helper text */
.pass-drupal-form p,
.user-pass p {
  color: #9ca3af;
  font-size: 0.85rem;
  line-height: 1.45;
  margin: 0;
}

/* Buttons (Brand Green #28aa4a) */
.login-drupal-form .form-actions,
.pass-drupal-form .form-actions {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-drupal-form .button,
.pass-drupal-form .button,
.login-drupal-form .form-submit,
.pass-drupal-form .form-submit,
.login-drupal-form input[type="submit"],
.pass-drupal-form input[type="submit"],
.button--primary {
  width: 100% !important;
  display: block !important;
  background-color: #28aa4a !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px;
  padding: 13px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  box-sizing: border-box;
  text-align: center;
  outline: none;
}

.login-drupal-form .button:hover,
.pass-drupal-form .button:hover,
.login-drupal-form input[type="submit"]:hover,
.pass-drupal-form input[type="submit"]:hover,
.button--primary:hover {
  background-color: #229440 !important;
}

.login-drupal-form .button:active,
.pass-drupal-form .button:active,
.login-drupal-form input[type="submit"]:active,
.pass-drupal-form input[type="submit"]:active,
.button--primary:active {
  background-color: #1e8238 !important;
  transform: scale(0.99);
}

.et-forgot-pass-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
  margin-bottom: 8px;
}

/* Navigation Links */
.forgot-password-link {
  color: #28aa4a;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  align-self: flex-end;
  transition: color 0.15s;
}

.forgot-password-link:hover {
  text-decoration: underline;
  color: #34c45a;
}

.auth-navigation-links {
  margin-top: 24px;
  text-align: center;
}

.back-to-login-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #28aa4a;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s, transform 0.15s;
}

.back-to-login-link svg {
  transition: transform 0.15s;
}

.back-to-login-link:hover {
  text-decoration: underline;
  color: #34c45a;
}

.back-to-login-link:hover svg {
  transform: translateX(-3px);
}

.login-footer {
  text-align: center;
  color: #6b7280;
  font-size: 0.8rem;
  margin-top: 36px;
}

/* Hide Drupal default tabs and generic titles */
nav.tabs,
h1.page-title,
.block-page-title-block {
  display: none !important;
}

.item-list ul {
  list-style: none;
  padding: 0;
  margin: 15px 0 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-list ul li a {
  color: #28aa4a;
  text-decoration: none;
  font-size: 0.9rem;
}

.item-list ul li a:hover {
  text-decoration: underline;
  color: #34c45a;
}

/* ==========================================================================
   Light Mode Theme
   ========================================================================== */
body.light-theme,
html.light-theme body {
  background-color: #f1f5f9;
  color: #0f172a;
}


body.light-theme .et-login-card {
  background-color: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

body.light-theme .et-login-left {
  background-color: #f8fafc;
}

body.light-theme .et-login-right {
  background-color: #ffffff;
  border-left: 1px solid #f1f5f9;
}

body.light-theme .theme-toggle {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

body.light-theme .theme-toggle:hover {
  background: #e2e8f0;
  color: #0f172a;
}


body.light-theme .login-form-container h1 {
  color: #0f172a;
}

body.light-theme .login-form-container .subtitle {
  color: #64748b;
}

body.light-theme .login-drupal-form label,
body.light-theme .pass-drupal-form label {
  color: #334155;
}

body.light-theme .login-drupal-form input[type="text"],
body.light-theme .login-drupal-form input[type="password"],
body.light-theme .login-drupal-form input[type="email"],
body.light-theme .pass-drupal-form input[type="text"],
body.light-theme .pass-drupal-form input[type="email"] {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.light-theme .login-drupal-form input[type="text"]:focus,
body.light-theme .login-drupal-form input[type="password"]:focus,
body.light-theme .login-drupal-form input[type="email"]:focus,
body.light-theme .pass-drupal-form input[type="text"]:focus,
body.light-theme .pass-drupal-form input[type="email"]:focus {
  background-color: #ffffff;
  border-color: #28aa4a !important;
  box-shadow: 0 0 0 3px rgba(40, 170, 74, 0.2) !important;
}

body.light-theme .et-password-toggle-btn {
  color: #64748b;
}

body.light-theme .et-password-toggle-btn:hover {
  color: #0f172a;
}

body.light-theme .pass-drupal-form p,
body.light-theme .user-pass p {
  color: #64748b;
}

body.light-theme .login-footer {
  color: #94a3b8;
}

body.light-theme .forgot-password-link,
body.light-theme .back-to-login-link {
  color: #28aa4a;
}

body.light-theme .forgot-password-link:hover,
body.light-theme .back-to-login-link:hover {
  color: #229440;
}

/* Light mode alerts */
body.light-theme [data-drupal-messages] [role="contentinfo"][aria-label="Error message"],
body.light-theme [data-drupal-messages] > [role="alert"],
body.light-theme .messages--error {
  background-color: #fef2f2;
  border-color: #fecaca;
  border-left: 5px solid #ef4444;
  color: #991b1b;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.08);
}

body.light-theme [data-drupal-messages] [role="contentinfo"][aria-label="Error message"] a,
body.light-theme [data-drupal-messages] [role="alert"] a,
body.light-theme .messages--error a {
  color: #b91c1c;
}

body.light-theme [data-drupal-messages] [role="contentinfo"][aria-label="Error message"] a:hover,
body.light-theme [data-drupal-messages] [role="alert"] a:hover,
body.light-theme .messages--error a:hover {
  color: #7f1d1d;
}

body.light-theme [data-drupal-messages] [role="contentinfo"][aria-label="Status message"],
body.light-theme .messages--status {
  background-color: #f0fdf4;
  border-color: #bbf7d0;
  border-left: 5px solid #28aa4a;
  color: #166534;
  box-shadow: 0 4px 12px rgba(40, 170, 74, 0.08);
}

body.light-theme [data-drupal-messages] [role="contentinfo"][aria-label="Status message"] a,
body.light-theme .messages--status a {
  color: #28aa4a;
}

body.light-theme .messages--warning {
  background-color: #fffbeb;
  border-color: #fde68a;
  border-left: 5px solid #f59e0b;
  color: #92400e;
}

body.light-theme .form-item input.error,
body.light-theme .form-item input[aria-invalid="true"] {
  border-color: #ef4444 !important;
  background-color: #fff5f5 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

body.light-theme .form-item--error-message {
  color: #b91c1c;
}

body.light-theme .dark-block {
  background-color: #1e293b;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 992px) {
  .et-login-card {
    flex-direction: column;
    min-height: auto;
  }
  .et-login-right {
    flex: 1;
    width: 100%;
    padding: 40px 24px;
  }
  .et-login-left {
    display: none;
  }
}
