/**
 * az-cont-pages.css — Stiluri unice pentru paginile Contul Meu
 * Prefix: az-cont-* — izolare față de restul site-ului
 * Pagini: login, înregistrare, resetare parolă, verificare email, confirmare email
 * Design: 1:1 cu componentele TSX din public_html/cont/components
 */

:root {
  --az-cont-primary:       #157efb;
  --az-cont-primary-hover: #1269d4;
  --az-cont-foreground:    #111827;
  --az-cont-muted:         #6b7280;
  --az-cont-border:        #e5e7eb;
  --az-cont-bg:            #fff;
  --az-cont-bg-page:       #f5f5f5;
  --az-cont-promo-bg:      #e8eef5;
}

/* ─── Page wrapper ─────────────────────────────────────────────────────────── */

.az-cont-page {
  min-height: 100vh;
  background: var(--az-cont-bg-page);
  padding: 40px 0 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  box-sizing: border-box;
}

/* Override containere înguste (#content, .container2) când conțin o pagină auth */
#content:has(> main.az-cont-page),
.container2:has(> #content > main.az-cont-page),
.container2:has(> main.az-cont-page) {
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.az-cont-page *, .az-cont-page *::before, .az-cont-page *::after {
  box-sizing: border-box;
}

.az-cont-page__inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 15px;
}

/* Two-column flex row — no background of its own; each card is independent */
.az-cont-page__row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: stretch;
}

/* Pe desktop: evita wrap când apar erori — păstrează layout side-by-side */
@media (min-width: 768px) {
  .az-cont-page__row {
    flex-wrap: nowrap;
  }
  .az-cont-card {
    min-width: 0; /* permite shrink în flexbox */
  }
  .az-cont-alert {
    overflow-wrap: break-word;
    word-break: break-word;
  }
}

/* ─── Form card (left column) ──────────────────────────────────────────────── */

.az-cont-card {
  flex: 1 1 400px;
  min-width: 280px;
  padding: 40px 36px;
  background: var(--az-cont-bg);
  border-radius: 16px;             /* rounded-2xl */
  border: 1px solid var(--az-cont-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); /* shadow-sm */
}

.az-cont-card__header {
  text-align: center;
  margin-bottom: 32px;
}

.az-cont-card__logo {
  display: block;
  margin-bottom: 0;
}

.az-cont-card__logo img {
  max-width: 200px;
  height: auto;
  margin: 0 auto;
  display: block;
}

/* Horizontal divider below logo — add <div class="az-cont-card__divider"> after logo */
.az-cont-card__divider {
  width: 100%;
  height: 1px;
  background: var(--az-cont-border);
  margin-top: 24px;
}

.az-cont-card__title {
  font-size: 28px;
  font-weight: 700;
  color: var(--az-cont-primary);
  margin: 24px 0 8px;
  line-height: 1.2;
}

/* When the header has no logo (e.g. register form), remove the extra top margin */
.az-cont-card__header .az-cont-card__title:first-child {
  margin-top: 0;
}

.az-cont-card__subtitle {
  font-size: 15px;
  color: var(--az-cont-muted);
  margin: 0;
}

.az-cont-card__section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--az-cont-primary);
  margin: 0 0 16px;
}

/* ─── Form fields ───────────────────────────────────────────────────────────── */

.az-cont-field {
  position: relative;
  margin-bottom: 16px;
}

/* Wrapper pentru input+icon — iconița se poziționează relativ la input, nu la hint/help-block */
.az-cont-field__input-wrap {
  position: relative;
  display: block;
}

/* Icon floated inside the input on the left */
.az-cont-field__icon {
  position: absolute;
  left: 16px;                      /* left-4 */
  top: 50%;
  transform: translateY(-50%);
  color: var(--az-cont-muted);
  pointer-events: none;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.az-cont-field__icon svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.az-cont-field__label svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.az-cont-field__input {
  width: 100%;
  padding: 16px 16px 16px 48px;   /* py-4, pl-12 */
  border: 1px solid var(--az-cont-border);
  border-radius: 12px;             /* rounded-xl */
  font-size: 14px;
  color: var(--az-cont-foreground) !important;
  background: var(--az-cont-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.az-cont-field__input:focus {
  outline: none;
  border-color: var(--az-cont-primary);
  box-shadow: 0 0 0 3px rgba(21, 126, 251, 0.15);
}

.az-cont-field__input::placeholder {
  color: var(--az-cont-muted);
}

.az-cont-field--has-error .az-cont-field__input {
  border-color: #ef4444;
}

/* Label above the input (used in reset-token form) */
.az-cont-field__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--az-cont-foreground);
  margin-bottom: 8px;
}

/* No left padding when using label-above style (no icon inside input) */
.az-cont-field--label-above .az-cont-field__input {
  padding-left: 16px;
}

/* Toggle button (show/hide password) — poziționat în input-wrap */
.az-cont-field__toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--az-cont-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s;
}

.az-cont-field__toggle:hover {
  color: var(--az-cont-foreground);
}

.az-cont-field__toggle svg {
  width: 20px;
  height: 20px;
}

/* Select field — săgeată custom cu padding corect */
.az-cont-field select.az-cont-field__input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 44px;
  background-color: var(--az-cont-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */

.az-cont-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;             /* py-4 */
  background: var(--az-cont-primary);
  color: #fff;
  border: none;
  border-radius: 12px;            /* rounded-xl */
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.az-cont-btn-primary:hover,
.az-cont-btn-primary:focus {
  background: var(--az-cont-primary-hover);
  color: #fff;
  text-decoration: none;
}

.az-cont-btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(21, 126, 251, 0.3);
}

.az-cont-btn-primary svg {
  width: 20px;
  height: 20px;
}

.az-cont-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;             /* py-3 px-6 */
  background: transparent;
  color: var(--az-cont-foreground);
  border: 1px solid var(--az-cont-border);
  border-radius: 12px;            /* rounded-xl */
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.az-cont-btn-outline:hover,
.az-cont-btn-outline:focus {
  border-color: var(--az-cont-primary);
  background: rgba(21, 126, 251, 0.05);
  color: var(--az-cont-foreground) !important;
  text-decoration: none;
}

.az-cont-btn-outline svg {
  width: 16px;
  height: 16px;
}

/* ─── Checkbox / Remember me ────────────────────────────────────────────────── */

.az-cont-checkbox-wrap {
  display: flex;
  align-items: center;
  justify-content: center;        /* centered like in TSX */
  gap: 12px;
  margin: 20px 0;
  cursor: pointer;
}

.az-cont-checkbox-wrap input {
  width: 16px;
  height: 16px;
  accent-color: var(--az-cont-primary);
  cursor: pointer;
}

.az-cont-checkbox-wrap span {
  font-size: 14px;
  color: var(--az-cont-muted);
  user-select: none;
}

/* ─── "sau" divider ─────────────────────────────────────────────────────────── */

.az-cont-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.az-cont-divider::before,
.az-cont-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--az-cont-border);
}

.az-cont-divider span {
  font-size: 12px;
  font-weight: 600;
  color: var(--az-cont-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── Secondary actions (Nu ai cont, Ai uitat parola) ───────────────────────── */

.az-cont-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ─── Promo sidebar (right column) ──────────────────────────────────────────── */

.az-cont-promo {
  flex: 0 1 380px;
  min-width: 280px;
  background: var(--az-cont-promo-bg);
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 16px;
  border: 1px solid #d4e0f0;
  overflow: hidden;
}

.az-cont-promo__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 32px 24px;
}

.az-cont-promo__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--az-cont-foreground);
  margin: 0 0 12px;
  line-height: 1.3;
}

.az-cont-promo__desc {
  font-size: 14px;
  color: var(--az-cont-muted);
  margin: 0;
  max-width: 260px;
}

.az-cont-promo__image {
  margin: 0 24px 24px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--az-cont-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.az-cont-promo__image img {
  width: 100%;
  height: auto;
  display: block;
}

.az-cont-promo__contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 32px 32px;
  gap: 16px;
}

.az-cont-promo__phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--az-cont-primary);
  color: #fff;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.az-cont-promo__phone:hover {
  background: var(--az-cont-primary-hover);
  color: #fff;
  text-decoration: none;
}

.az-cont-promo__phone svg {
  width: 16px;
  height: 16px;
}

.az-cont-promo__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--az-cont-primary);
  text-decoration: none;
}

.az-cont-promo__link:hover {
  text-decoration: underline;
}

.az-cont-promo__link svg {
  width: 14px;
  height: 14px;
}

/* Legacy promo img class (fallback) */
.az-cont-promo__img {
  margin: 0 24px 24px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--az-cont-border);
}

.az-cont-promo__img img {
  width: 100%;
  height: auto;
  display: block;
}

/* ─── Alerts ────────────────────────────────────────────────────────────────── */

.az-cont-alert {
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}

/* Green — success */
.az-cont-alert--success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* Amber — warning */
.az-cont-alert--warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.az-cont-alert--with-icon {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.az-cont-alert--with-icon svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Red — danger/error */
.az-cont-alert--danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* ─── Help / error text ─────────────────────────────────────────────────────── */

.az-cont-help-block {
  display: block;
  font-size: 13px;
  color: #ef4444;
  font-weight: 500;
  margin-top: 6px;
}

.az-cont-field__hint {
  display: block;
  font-size: 12px;
  color: var(--az-cont-muted);
  margin-top: 6px;
}

/* ─── Back link ─────────────────────────────────────────────────────────────── */

.az-cont-back-link-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  padding-top: 24px;
}

.az-cont-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--az-cont-foreground);
  text-decoration: none;
  border: 1px solid var(--az-cont-border);
  border-radius: 12px;
  padding: 12px 24px;
  transition: border-color 0.2s, background 0.2s;
}

.az-cont-back-link:hover {
  border-color: var(--az-cont-primary);
  background: rgba(21, 126, 251, 0.05);
  color: var(--az-cont-foreground);
  text-decoration: none;
}

.az-cont-back-link svg {
  width: 16px;
  height: 16px;
}

/* ─── Radio group (Tip Persoană, TVA) ──────────────────────────────────────── */

.az-cont-type-selector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.az-cont-type-selector__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--az-cont-foreground);
}

.az-cont-radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}

/* Register submit button - not full width, centered */
.az-cont-reg-submit {
  display: flex;
  justify-content: center;
  padding-top: 16px;
}

.az-cont-reg-submit .az-cont-btn-primary {
  width: auto;
  padding: 16px 48px;
}

.az-cont-radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.az-cont-radio-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--az-cont-primary);
  cursor: pointer;
}

.az-cont-radio-item span {
  font-size: 14px;
  color: var(--az-cont-foreground);
}

/* ─── Register form grid (2 columns) ────────────────────────────────────────── */

/* Used in login for side-by-side email+password fields */
.az-cont-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.az-cont-form-row .az-cont-field {
  flex: 1 1 200px;
  min-width: 0;
  margin-bottom: 0;
}

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

@media (max-width: 991px) {
  .az-cont-card {
    padding: 28px 24px;
  }
  .az-cont-promo__header {
    padding: 28px 24px 20px;
  }
  .az-cont-promo__contact {
    padding: 0 24px 24px;
  }
}

@media (max-width: 767px) {
  .az-cont-page {
    padding: 20px 0 40px;
  }
  .az-cont-page__inner {
    padding: 0 12px;
  }
  .az-cont-page__row {
    flex-direction: column;
    gap: 16px;
  }
  .az-cont-card {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 24px 20px;
  }
  .az-cont-promo {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 16px;
  }
  .az-cont-actions {
    flex-direction: column;
  }
  .az-cont-btn-outline {
    width: 100%;
  }
  .az-cont-form-row {
    flex-direction: column;
  }
  /* Fix: câmpurile nu trebuie să crească (flex-grow) — altfel iconițele (top: 50%) apar sub input */
  .az-cont-form-row .az-cont-field {
    flex: 0 0 auto;
  }
}

/* Ecrane foarte înguste (iPhone, etc.) — formular folosește aproape toată lățimea */
@media (max-width: 480px) {
  .az-cont-page {
    padding: 16px 0 32px;
  }
  .az-cont-page__inner {
    padding: 0 10px;
  }
  .az-cont-card {
    padding: 20px 16px;
  }
  .az-cont-card__logo img {
    max-width: 100%;
  }
  .az-cont-card__title {
    font-size: 24px;
  }
  .az-cont-promo__header {
    padding: 24px 20px 16px;
  }
  .az-cont-promo__contact {
    padding: 0 20px 24px;
  }
}
