/* ═══════════════════════════════════════════════════════════════
   ACONS Management – Keycloak Login Theme
   Brand: #8B0000 (dark red), #a51c1c (lighter), #6b0000 (darker)
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset & base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.acons-page {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: #1f2937;
  background: #ffffff;
  min-height: 100vh;
}

/* ── Centered container ── */
.acons-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

/* ── Logo ── */
.acons-logo {
  margin-bottom: 1.5rem;
}

.acons-logo img {
  height: 60px;
  width: auto;
  display: block;
}

/* ── Locale selector ── */
.acons-locale {
  margin-bottom: 1rem;
}

.acons-locale select {
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
  color: #374151;
  background: #fff;
  cursor: pointer;
}

/* ── Card ── */
.acons-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  width: 100%;
  max-width: 400px;
  padding: 2rem;
}

/* ── Page title ── */
.acons-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* ── Attempted username (re-auth flow) ── */
.acons-attempted-user {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  color: #374151;
}

.acons-attempted-user a {
  color: #8B0000;
  text-decoration: none;
  font-size: 1.125rem;
}

/* ── Required fields hint ── */
.acons-required-hint {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.acons-required {
  color: #dc2626;
}

/* ── Alert messages ── */
.acons-alert {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  margin-bottom: 1rem;
}

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

.acons-alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.acons-alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.acons-alert-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* ── Form fields ── */
.acons-field {
  margin-bottom: 1rem;
}

.acons-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}

.acons-field input[type="text"],
.acons-field input[type="password"] {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  color: #1f2937;
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.acons-field input:focus {
  border-color: #8B0000;
  box-shadow: 0 0 0 2px rgba(139, 0, 0, 0.15);
}

/* ── Password field with toggle ── */
.acons-password-wrapper {
  position: relative;
  display: flex;
}

.acons-password-wrapper input {
  flex: 1;
  border-radius: 0.5rem 0 0 0.5rem;
}

.acons-password-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  border: 1px solid #d1d5db;
  border-left: none;
  border-radius: 0 0.5rem 0.5rem 0;
  background: #f9fafb;
  color: #6b7280;
  cursor: pointer;
  font-size: 0.875rem;
}

.acons-password-toggle:hover {
  background: #f3f4f6;
  color: #374151;
}

/* ── Error messages under fields ── */
.acons-error {
  display: block;
  font-size: 0.75rem;
  color: #dc2626;
  margin-top: 0.25rem;
}

/* ── Options row (remember me + forgot password) ── */
.acons-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  font-size: 0.8125rem;
}

.acons-checkbox {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: #374151;
  cursor: pointer;
}

.acons-checkbox input {
  accent-color: #8B0000;
}

/* ── Links ── */
.acons-link,
a {
  color: #8B0000;
  text-decoration: none;
  font-size: 0.8125rem;
}

.acons-link:hover,
a:hover {
  color: #a51c1c;
  text-decoration: underline;
}

/* ── Primary button ── */
.acons-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: #8B0000;
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s;
}

.acons-btn:hover {
  background: #a51c1c;
}

.acons-btn:focus {
  background: #6b0000;
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.25);
}

/* ── Info section (registration link) ── */
.acons-info {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #6b7280;
}

.acons-register {
  text-align: center;
}

/* ── Social providers ── */
.acons-social {
  margin-top: 1.25rem;
}

.acons-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

.acons-divider::before,
.acons-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.acons-social-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.acons-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #374151;
  font-size: 0.8125rem;
  text-decoration: none;
  transition: background-color 0.15s;
}

.acons-social-btn:hover {
  background: #f9fafb;
  color: #374151;
  text-decoration: none;
}

/* ── PatternFly overrides (required actions: update-profile, etc.) ── */
.acons-card .form-group {
  margin-bottom: 1rem;
}

.acons-card .form-group > div:first-child {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #dc2626;
  margin-bottom: 0.375rem;
}

.acons-card .pf-c-form__label,
.acons-card .pf-c-form__label-text {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
}

.acons-card .pf-c-form-control {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  color: #1f2937;
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.acons-card .pf-c-form-control:focus {
  border-color: #8B0000;
  box-shadow: 0 0 0 2px rgba(139, 0, 0, 0.15);
}

.acons-card .pf-c-form__helper-text.pf-m-error {
  display: block;
  font-size: 0.75rem;
  color: #dc2626;
  margin-top: 0.25rem;
}

.acons-card .pf-c-button.pf-m-primary {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: #8B0000;
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s;
  margin-top: 0.5rem;
}

.acons-card .pf-c-button.pf-m-primary:hover {
  background: #a51c1c;
}

.acons-card .pf-c-button.pf-m-primary:focus {
  background: #6b0000;
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.25);
}

/* ── Toggle hasla na stronach z motywu bazowego (aktualizacja hasla, reset) ──
   Keycloak renderuje tam <button data-password-toggle><i class="fa fa-eye"></i></button>
   i liczy na font Font Awesome z arkuszy rodzica. Nasz theme.properties ustawia
   styles=css/styles.css, co ZASTEPUJE liste rodzica - font sie nie laduje i przycisk
   zostaje pusty. Rysujemy te same ikony co w login.ftl, maska SVG zamiast fontu. */
/* Sama ikona, bez ramki i tla - przycisk ma znikac, zostaje oko. */
button[data-password-toggle] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: 0.5rem;
  border: none;
  background: transparent;
  box-shadow: none;
  color: #9ca3af;
  cursor: pointer;
  line-height: 0;
}

button[data-password-toggle]:hover,
button[data-password-toggle]:focus {
  background: transparent;
  box-shadow: none;
  color: #6b7280;
}

/* Keycloak owija pole i przycisk we wspolny kontener. Bez arkuszy rodzica nie ma on
   ukladu, przez co ikona ladowala pod polem - ustawiamy ja w jednej linii po prawej. */
.pf-c-input-group,
.pf-v5-c-input-group {
  display: flex;
  align-items: center;
}

.pf-c-input-group > input,
.pf-v5-c-input-group > input {
  flex: 1 1 auto;
  min-width: 0;
}

button[data-password-toggle] i {
  display: inline-block;
  width: 18px;
  height: 18px;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
}

button[data-password-toggle] i.fa-eye {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M1%2012s4-8%2011-8%2011%208%2011%208-4%208-11%208-11-8-11-8z%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%223%22%2F%3E%3C%2Fsvg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M1%2012s4-8%2011-8%2011%208%2011%208-4%208-11%208-11-8-11-8z%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%223%22%2F%3E%3C%2Fsvg%3E");
}

button[data-password-toggle] i.fa-eye-slash {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M17.94%2017.94A10.07%2010.07%200%200%201%2012%2020c-7%200-11-8-11-8a18.45%2018.45%200%200%201%205.06-5.94M9.9%204.24A9.12%209.12%200%200%201%2012%204c7%200%2011%208%2011%208a18.5%2018.5%200%200%201-2.16%203.19m-6.72-1.07a3%203%200%201%201-4.24-4.24%22%2F%3E%3Cline%20x1%3D%221%22%20y1%3D%221%22%20x2%3D%2223%22%20y2%3D%2223%22%2F%3E%3C%2Fsvg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M17.94%2017.94A10.07%2010.07%200%200%201%2012%2020c-7%200-11-8-11-8a18.45%2018.45%200%200%201%205.06-5.94M9.9%204.24A9.12%209.12%200%200%201%2012%204c7%200%2011%208%2011%208a18.5%2018.5%200%200%201-2.16%203.19m-6.72-1.07a3%203%200%201%201-4.24-4.24%22%2F%3E%3Cline%20x1%3D%221%22%20y1%3D%221%22%20x2%3D%2223%22%20y2%3D%2223%22%2F%3E%3C%2Fsvg%3E");
}
