/* ============================================================
   Auth pages: login, register, password, logout-confirm
   Split layout: Instagram grid left | Form right
   ============================================================ */

/* ── Layout wrapper ─────────────────────────────────────── */

.auth-layout-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ── Left panel: Instagram grid ─────────────────────────── */

.auth-instagram-panel {
  position: relative;
  width: 42%;
  flex-shrink: 0;
  overflow: hidden;
  background: #ffffff;
  min-height: 100vh;
}

.auth-instagram-grid {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: -20%;   /* extend past panel left edge → col 1 is partially clipped */
  display: flex;
  gap: 12px;
  padding: 12px 12px 12px 0;
}

.auth-instagram-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

/* All 3 columns use negative margin-top so the first image in each
   column bleeds above the panel boundary and is clipped there —
   no empty space at the top of any column.
   Different values create the cascading mosaic stagger. */
.auth-instagram-col:nth-child(1) {
  margin-top: -60px;
}

.auth-instagram-col:nth-child(2) {
  margin-top: -180px;
}

.auth-instagram-col:nth-child(3) {
  margin-top: -110px;
}

/* Padding-bottom hack: the oldest and most reliable way to lock
   a 4:5 portrait ratio (height = 125% of width).
   Works in all browsers, unaffected by flex-context quirks.
   The image is positioned absolute to fill the padding space. */
.auth-instagram-item {
  display: block;
  width: 100%;
  flex-shrink: 0;
  position: relative;
  height: 0;
  padding-bottom: 125%; /* 5 ÷ 4 × 100 = 125% → portrait 4:5 */
  overflow: hidden;
  border-radius: 14px;
  text-decoration: none;
}

.auth-instagram-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transition: transform 0.4s ease;
}

.auth-instagram-item:hover img {
  transform: scale(1.04);
}

.auth-instagram-overlay {
  display: none;
}

/* Fallback solid background when no posts */
.auth-instagram-fallback {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
}

/* ── Right panel: Form ───────────────────────────────────── */

.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 48px 40px;
  min-height: 100vh;
  overflow-y: auto;
}

.auth-form-inner {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center; /* Center logo and everything else */
}

/* ── Logo: centered, bigger ─────────────────────────────── */

.auth-logo {
  margin-bottom: 36px;
  text-align: center;
  width: 100%;
}

.auth-logo a {
  display: inline-block;
}

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

/* ── Title & subtitle: full width, left-aligned ─────────── */

.auth-title {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  border: none;
  padding: 0;
  width: 100%;
  text-align: left;
}

.auth-subtitle {
  font-size: 14px;
  color: #777;
  margin-bottom: 28px;
  width: 100%;
  text-align: left;
}

.auth-subtitle a {
  color: #d6121f;
  font-weight: 600;
  text-decoration: none;
}

.auth-subtitle a:hover {
  color: #a50e17;
  text-decoration: underline;
}

/* ── Status/error messages ──────────────────────────────── */

.auth-messages {
  margin-bottom: 20px;
  width: 100%;
}

.auth-messages .messages {
  border-radius: 10px;
  font-size: 14px;
}

/* ── Form content wrapper ───────────────────────────────── */

.auth-form-content {
  width: 100%;
}

/* ── Hide Drupal elements that duplicate our custom layout ─ */

/* Page-level navigation tabs (login / register / password nav) */
.auth-form-panel .tabs,
.auth-form-panel nav[role="navigation"],
.auth-form-panel .block-page-title-block .page-title,
.auth-form-panel .block-page-title-block h1 {
  display: none !important;
}

/* Honeypot anti-spam field */
.auth-form-panel .js-form-item-url {
  display: none !important;
}

/* ============================================================
   UNIVERSAL FORM FIELD CARD STYLING
   Applies to ALL form items in auth pages — including custom
   fields (Επωνυμία, ΑΦΜ, ΔΟΥ, etc.) and standard fields.
   ============================================================ */

/* Base card for every .js-form-item */
.auth-form-panel .js-form-item {
  background: #ffffff;
  border: 1.5px solid #e2e2e2;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

/* Regular card fields with description: square bottom + attach description below */
.auth-form-panel .js-form-item:not(.auth-field-body .js-form-item):not(.js-form-type-password-confirm):has(.description) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none;
  padding-bottom: 10px;
  margin-bottom: 0 !important;
}

.auth-form-panel .js-form-item:not(.auth-field-body .js-form-item):not(.js-form-type-password-confirm) .description {
  display: block;
  margin: 0 -17px 12px;
  padding: 8px 16px 10px;
  background: #ffffff;
  border: 1.5px solid #e2e2e2;
  border-top: none;
  border-radius: 0 0 12px 12px;
  font-size: 11px;
  color: #aaa;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

/* Description for password-confirm wrapper: simple note, no card continuation */
.auth-form-panel .js-form-type-password-confirm .description {
  display: block;
  font-size: 11px;
  color: #aaa;
  line-height: 1.5;
  margin-top: 6px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

/* Description hint for auth-field-card fields (rendered outside card via PHP suffix) */
.auth-field-hint {
  font-size: 11px;
  color: #aaa;
  line-height: 1.5;
  margin: 0 0 12px;
  padding: 7px 16px 9px;
  background: #f4f4f4;
  border: 1.5px solid #e2e2e2;
  border-top: none;
  border-radius: 0 0 12px 12px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.auth-form-panel .js-form-item:focus-within {
  border-color: #d6121f;
  box-shadow: 0 0 0 3px rgba(214, 18, 31, 0.08);
}

/* Labels inside ALL cards */
.auth-form-panel .js-form-item label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #999;
  margin-bottom: 4px;
  line-height: 1;
}

.auth-form-panel .js-form-item label .form-required {
  color: #d6121f;
}

/* Text/email/select inputs inside ALL cards */
.auth-form-panel .js-form-item .form-control,
.auth-form-panel .js-form-item select.form-select,
.auth-form-panel .js-form-item select {
  border: none !important;
  padding: 0 !important;
  height: auto !important;
  min-height: auto !important;
  line-height: 1.4;
  font-size: 15px;
  color: #1a1a1a;
  box-shadow: none !important;
  background: transparent !important;
  width: 100%;
  -webkit-appearance: auto;
  appearance: auto;
}

.auth-form-panel .js-form-item .form-control:focus,
.auth-form-panel .js-form-item select:focus {
  outline: none;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  color: #1a1a1a;
}

/* Description / help text */
.auth-form-panel .js-form-item .description {
  font-size: 12px;
  color: #aaa;
  margin-top: 4px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: normal;
}

/* ── Exception: password-confirm OUTER wrapper ──────────── */
/* It IS a .js-form-item but contains two separate card sub-fields.
   Strip the card so only the inner pass1/pass2 divs show cards. */
.auth-form-panel .js-form-type-password-confirm {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin-bottom: 0 !important;
  box-shadow: none !important;
}

/* ── Exception: icon-wrapped fields (inside auth-field-card) ─ */
/* auth-field-card already provides the card look; the .js-form-item
   inside .auth-field-body must be stripped so there's no double card. */
.auth-field-body .js-form-item,
.auth-field-body .form-item {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

/* Labels inside icon-card body */
.auth-field-body .js-form-item label,
.auth-field-body .form-item label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #999;
  margin-bottom: 4px;
}

/* Inputs inside icon-card body */
.auth-field-body .js-form-item .form-control,
.auth-field-body .form-item .form-control {
  border: none !important;
  padding: 0 !important;
  height: auto !important;
  font-size: 15px;
  box-shadow: none !important;
  background: transparent !important;
}

/* ── Icon-card wrapper (auth-field-card) ────────────────── */

.auth-field-card {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #e2e2e2;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* When followed by a hint, square the bottom corners and remove bottom border */
.auth-field-card:has(+ .auth-field-hint) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none;
  margin-bottom: 0 !important;
}

.auth-field-card:focus-within {
  border-color: #d6121f;
  box-shadow: 0 0 0 3px rgba(214, 18, 31, 0.08);
}

/* Extend red border to the hint below when field is focused */
.auth-field-card:focus-within + .auth-field-hint {
  border-color: #d6121f;
}

.auth-field-icon {
  width: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c0c0c0;
  font-size: 16px;
  margin-right: 12px;
  transition: color 0.2s ease;
}

.auth-field-card:focus-within .auth-field-icon {
  color: #d6121f;
}

.auth-field-body {
  flex: 1;
  min-width: 0;
}

/* ── Password pass1/pass2: now use auth-field-card via PHP after_build ── */
/* No extra CSS needed — they inherit the same auth-field-card styling. */

/* Password strength/confirm indicators */
.auth-form-panel .password-strength,
.auth-form-panel .password-confirm {
  font-size: 12px;
  margin-top: 6px;
}

/* ── Submit button ────────────────────────────────────────── */

.auth-form-panel .form-actions {
  margin-top: 20px;
}

/* Target both <button> (Bootstrap Barrio) and <input type="submit"> */
.auth-form-panel .form-actions button[type="submit"],
.auth-form-panel .form-actions input[type="submit"],
.auth-form-panel .form-actions .btn-primary {
  display: block;
  width: 100%;
  padding: 15px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-align: center;
  background-color: #d6121f !important;
  border-color: #d6121f !important;
  color: #ffffff !important;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.auth-form-panel .form-actions button[type="submit"]:hover,
.auth-form-panel .form-actions input[type="submit"]:hover,
.auth-form-panel .form-actions .btn-primary:hover {
  background-color: #a50e17 !important;
  border-color: #a50e17 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.auth-form-panel .form-actions button[type="submit"]:active,
.auth-form-panel .form-actions input[type="submit"]:active {
  transform: translateY(0);
}

/* Hide gin_login's extra links block (uninstalled but defensive rule) */
.auth-form-panel .more-links {
  display: none !important;
}

/* ── Extra navigation links below form ──────────────────── */

.auth-extra-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  font-size: 13px;
  width: 100%;
}

.auth-extra-links a {
  color: #d6121f;
  text-decoration: none;
}

.auth-extra-links a:hover {
  text-decoration: underline;
  color: #a50e17;
}

/* ── Logout confirm page ─────────────────────────────────── */

.auth-layout-wrapper--logout {
  height: 100vh;
  overflow: hidden;
}

.auth-layout-wrapper--logout .auth-form-panel {
  overflow-y: hidden;
}

.auth-logout-icon {
  width: 80px;
  height: 80px;
  background: #fff4f4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 34px;
  color: #d6121f;
}

.auth-logout-text {
  text-align: center;
  color: #555;
  font-size: 15px;
  margin-bottom: 32px;
  line-height: 1.6;
  width: 100%;
}

.auth-logout-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  align-items: stretch;
}

/* page.content renders: div.block > div.content > form > div.form-actions > button
   Each level must be flex so height propagates all the way to the button. */
.auth-logout-actions > div,
.auth-logout-actions > section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.auth-logout-actions .content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.auth-logout-actions form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.auth-logout-actions .form-actions {
  flex: 1;
  margin-top: 0;
  display: flex;
}

.auth-logout-actions .form-actions button[type="submit"],
.auth-logout-actions .form-actions input[type="submit"] {
  flex: 1;
  width: 100%;
}

.auth-btn-cancel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: #ffffff;
  border: 1.5px solid #e2e2e2;
  color: #555555;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.auth-btn-cancel:hover {
  background: #f0f0ee;
  border-color: #ccc;
  color: #333;
  text-decoration: none;
}

/* ── Fieldset/fieldgroup overrides ──────────────────────── */

.auth-form-panel fieldset.form-wrapper,
.auth-form-panel fieldset .fieldset-wrapper {
  border: none;
  padding: 0;
  margin: 0;
}

.auth-form-panel fieldset legend {
  display: none;
}

/* ── Register form fieldset groups ──────────────────────── */

.auth-fieldset {
  border: 1.5px solid #e2e2e2;
  border-radius: 16px;
  padding: 24px 20px 12px;
  margin-bottom: 24px;
  background: #fafafa;
  position: relative;
}

.auth-fieldset-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 0.2px;
  margin: -24px -20px 20px;
  padding: 14px 20px;
  border-bottom: 1.5px solid #e2e2e2;
  border-radius: 14px 14px 0 0;
  background: #ffffff;
}

/* Last field inside fieldset shouldn't double up margin */
.auth-fieldset > *:last-child,
.auth-fieldset .js-form-item:last-child,
.auth-fieldset .auth-field-hint:last-child {
  margin-bottom: 0 !important;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 991px) and (min-width: 768px) {
  .auth-instagram-panel {
    width: 36%;
  }

  .auth-form-panel {
    padding: 40px 28px;
  }
}

@media (max-width: 767px) {
  /* On mobile, hide the Instagram panel — form takes full width */
  .auth-instagram-panel {
    display: none;
  }

  .auth-form-panel {
    padding: 32px 20px;
  }

  .auth-form-inner {
    max-width: 100%;
  }

  .auth-title {
    font-size: 26px;
  }
}
