/* YaarWin auth — pixel-match to reference screenshots */
:root {
  --green: #18d48c;
  --green-dark: #0cd781;
  --green-light: #00e989;
  --green-muted: #b8dbc8;
  --green-muted-text: #3d8f6f;
  --bg-page: #f2f2f1;
  --bg-input: #ffffff;
  --text-dark: #223935;
  --text-label: #4a5f57;
  --text-muted: #9aa8a3;
  --text-placeholder: #b6c8bf;
  --border-line: #d8ebe4;
  --red: #d23838;
  --auth-max: 460px;
  --input-h: 46px;
  --btn-h: 48px;
  --radius: 12px;
}

* { box-sizing: border-box; }

html.auth-html { font-size: 17px; }

body.auth-body {
  margin: 0;
  font-family: Roboto, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-page);
  color: var(--text-dark);
  min-height: 100dvh;
}

.auth-app {
  max-width: var(--auth-max);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg-page);
  position: relative;
  padding-bottom: 70px;
}

/* ===== Green header (navbar + title inside) ===== */
.auth-header {
  background: linear-gradient(180deg, #1ad68f 0%, #18d48c 55%, #14c97f 100%);
  padding: 0 0 22px;
  color: #fff;
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 14px;
}

.auth-topbar .back-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.auth-logo svg {
  height: 30px;
  width: auto;
}

.auth-lang {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  min-width: 52px;
  justify-content: flex-end;
}

.auth-lang .flag {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.35);
}

.auth-header h1 {
  margin: 8px 20px 10px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.auth-header .sub {
  margin: 0 20px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255,255,255,0.95);
}

.auth-header .sub p {
  margin: 0 0 3px;
}

/* ===== Tabs (login) ===== */
.auth-tabs {
  display: flex;
  background: var(--bg-page);
  padding: 0;
}

.auth-tabs .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 4px 12px;
  border: none;
  border-bottom: 2px solid var(--border-line);
  background: none;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.auth-tabs .tab svg {
  width: 26px;
  height: 26px;
}

.auth-tabs .tab.active {
  color: var(--green-dark);
  border-bottom-color: var(--green-dark);
}

.auth-tabs .tab.active svg {
  color: var(--green-dark);
}

/* ===== Register single tab ===== */
.register-tab-single {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 0 4px;
  color: var(--green-dark);
  font-size: 15px;
  font-weight: 600;
  background: var(--bg-page);
}

.register-tab-single svg {
  width: 26px;
  height: 26px;
}

.register-tab-line {
  height: 2px;
  background: var(--green-dark);
  margin: 10px 20px 8px;
  border-radius: 1px;
}

/* ===== Form ===== */
.auth-form-wrap {
  padding: 24px 20px 0;
}

.field-block {
  margin-bottom: 28px;
}

.field-block:last-of-type {
  margin-bottom: 20px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-label);
}

.field-label svg {
  width: 22px;
  height: 22px;
  color: var(--green-dark);
  flex-shrink: 0;
}

/* Split phone: country box + number box */
.phone-row {
  display: flex;
  gap: 12px;
}

.dial-box {
  flex: 0 0 88px;
  height: var(--input-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--bg-input);
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: default;
  padding: 0 10px;
}

.dial-box svg {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
}

.phone-row input {
  flex: 1;
  height: var(--input-h);
  padding: 0 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--bg-input);
  font-size: 16px;
  color: var(--text-dark);
  outline: none;
  min-width: 0;
}

.phone-row input::placeholder {
  color: var(--text-placeholder);
  font-size: 15px;
}

.field-input input {
  width: 100%;
  height: var(--input-h);
  padding: 0 44px 0 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--bg-input);
  font-size: 16px;
  color: var(--text-dark);
  outline: none;
}

.field-input input::placeholder {
  color: var(--text-placeholder);
  font-size: 15px;
}

.field-input {
  position: relative;
}

.pw-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  opacity: 0.55;
}

.pw-toggle img {
  width: 100%;
  height: 100%;
}

.remember-row {
  margin: 8px 0 16px;
}

.remember-row label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text-muted);
  cursor: pointer;
}

.remember-row input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid #ccc;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  position: relative;
}

.remember-row input[type="checkbox"]:checked {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.remember-row input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.agree-row {
  margin: 20px 0 24px;
  font-size: 15px;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

.agree-row input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid #ccc;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}

.agree-row input[type="checkbox"]:checked {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.agree-row a {
  color: var(--red);
  text-decoration: none;
}

/* ===== Buttons ===== */
.auth-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-top: 20px;
}

.btn-login {
  width: 100%;
  height: var(--btn-h);
  border: none;
  border-radius: var(--btn-h);
  font-size: 18px;
  font-weight: 700;
  background: var(--green-muted);
  color: var(--green-muted-text);
  cursor: not-allowed;
}

.btn-login.active {
  background: linear-gradient(90deg, var(--green-dark), var(--green-light));
  color: #fff;
  cursor: pointer;
}

.btn-register-outline {
  width: 100%;
  height: var(--btn-h);
  border: 1.5px solid var(--green-dark);
  border-radius: var(--btn-h);
  font-size: 18px;
  font-weight: 700;
  background: #fff;
  color: var(--green-dark);
  cursor: pointer;
}

.btn-register-fill {
  width: 100%;
  height: var(--btn-h);
  border: none;
  border-radius: var(--btn-h);
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(90deg, #0cd781 0%, #18d48c 50%, #00e989 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(12, 215, 129, 0.4);
}

.btn-register-fill:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-have-account {
  width: 100%;
  height: var(--btn-h);
  border: 1px solid #e0e0e0;
  border-radius: var(--btn-h);
  font-size: 16px;
  font-weight: 400;
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-have-account strong {
  color: var(--green-dark);
  font-weight: 700;
}

/* ===== Footer links (login) ===== */
.auth-footer-links {
  display: flex;
  justify-content: center;
  margin-top: 32px;
  gap: 0;
}

.auth-footer-links .link-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

.auth-footer-links .link-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 8px;
  display: grid;
  place-items: center;
}

.auth-footer-links .link-icon img,
.auth-footer-links .link-icon svg {
  width: 36px;
  height: 36px;
}

.auth-legal-links {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 16px;
  line-height: 1.8;
}

.auth-legal-links a {
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer-links span {
  font-size: 14px;
  color: var(--text-label);
}

/* ===== Floating support button ===== */
.auth-fab {
  position: fixed;
  right: max(16px, calc(50% - var(--auth-max) / 2 + 16px));
  bottom: 24px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid transparent;
  background-image: linear-gradient(#fff, #fff), linear-gradient(135deg, var(--green-dark), var(--green-light));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 4px 14px rgba(12, 215, 129, 0.35);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 50;
  text-decoration: none;
}

.auth-fab img {
  width: 30px;
  height: 30px;
}

.form-error {
  color: var(--red);
  font-size: 14px;
  text-align: center;
  margin: 8px 0;
  display: none;
}

.form-error.show { display: block; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.hidden { display: none !important; }
