﻿/* =========================================================
   Replica of glovoapp.com/en/login (Glovo "pintxo" design system)
   Values extracted from the production CSS of glovoapp.com
   ========================================================= */

/* ----- Glovo Sans (local copies of their font files) ----- */
@font-face {
  font-family: 'Glovo Sans';
  font-weight: 400;
  font-display: fallback;
  src: url('fonts/GlovoSans-Book.woff2') format('woff2');
}
@font-face {
  font-family: 'Glovo Sans';
  font-weight: 500;
  font-display: fallback;
  src: url('fonts/GlovoSans-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Glovo Sans';
  font-weight: 700;
  font-display: fallback;
  src: url('fonts/GlovoSans-Bold.woff2') format('woff2');
}

/* ----- Design tokens (from :root of glovoapp.com) ----- */
:root {
  --bg-primary: rgb(255, 255, 255);
  --bg-secondary: rgb(242, 242, 243);
  --text-primary: rgb(22, 22, 23);
  --text-secondary: rgb(98, 99, 100);
  --border-primary: rgb(205, 206, 208);
  --border-hover: rgb(187, 188, 191);
  --green-enabled: rgb(1, 121, 99);      /* button bg */
  --green-hover: rgb(3, 89, 73);         /* button hover bg / links */
  --green-focus: rgb(0, 158, 129);

  --spacing-xs: 8px;
  --spacing-s: 12px;
  --spacing-m: 16px;
  --spacing-l: 24px;

  --input-height-m: 56px;
  --input-radius: 8px;
  --btn-height-m: 48px;
  --btn-radius: 896px; /* pill */
  --shadow-floating: 0 0 24px rgba(22, 23, 23, 0.21), 0 0 2px rgba(22, 23, 23, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Glovo Sans', Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ===== Header with logo ===== */
.site-header {
  display: flex;
  align-items: center;
  padding: var(--spacing-s) var(--spacing-m);
}

.site-header .logo {
  width: 128px;
  height: auto;
  display: block;
}

/* ===== Main ===== */
.page-main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0 var(--spacing-m) var(--spacing-l);
}


/* ===== Login form ===== */
.login-card {
  width: 640px;
  max-width: 100%;
  background: var(--bg-primary);
  padding: 0 var(--spacing-m) var(--spacing-l);
  display: flex;
  flex-direction: column;
}

/* Close button */
.login-nav { display: flex; justify-content: flex-end; }

.icon-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.24s cubic-bezier(0.42, 0, 0.58, 1);
}

.icon-btn:hover { background: var(--border-primary); }
.icon-btn svg { width: 20px; height: 20px; }

/* Headings */
.login-header {
  text-align: center;
  font-size: 28px;   /* --text-size-xxl */
  line-height: 32px;
  font-weight: 700;
  margin-bottom: var(--spacing-m);
  padding-top: var(--spacing-m);
}

.login-text {
  text-align: center;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  margin-bottom: var(--spacing-l);
}

/* ===== Phone inputs ===== */
.phone-inputs {
  display: flex;
  gap: var(--spacing-s);
}

.field {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.field-prefix { width: 144px; flex-shrink: 0; } /* spacing-m * 9, same as the site */

.field-label {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
}

.field input,
.select-trigger {
  height: var(--input-height-m);
  border: 1px solid var(--border-primary);
  border-radius: var(--input-radius);
  background: var(--bg-primary);
  padding: 0 var(--spacing-s);
  font-family: inherit;
  font-size: 16px;
  line-height: 20px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  transition: border-color 0.24s cubic-bezier(0.42, 0, 0.58, 1);
}

.field input::placeholder { color: rgb(160, 161, 164); font-weight: 400; }

.field input:hover,
.select-trigger:hover { border-color: var(--border-hover); }

.field input:focus,
.select-trigger:focus {
  border-color: var(--green-enabled);
  box-shadow: inset 0 0 0 1px var(--green-enabled);
}

/* invalid phone state */
.field input.invalid {
  border-color: rgb(212, 22, 22);
  box-shadow: inset 0 0 0 1px rgb(212, 22, 22);
}

.field-error {
  margin-top: 6px;
  font-size: 12px;
  line-height: 16px;
  color: rgb(212, 22, 22);
}

/* ===== Prefix custom dropdown ===== */
.select-wrap { position: relative; }

.select-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
}

.select-trigger .flag {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 3px;
}

.select-trigger .abbr,
.select-trigger .code {
  flex-shrink: 0;
}

.select-trigger .abbr {
  font-weight: 700;
  font-size: 14px;
}

.select-trigger .code {
  font-size: 15px;
}

.select-trigger .chevron {
  margin-left: auto;
  transition: transform 0.24s cubic-bezier(0.42, 0, 0.58, 1);
}

.select-trigger[aria-expanded='true'] .chevron { transform: rotate(180deg); }

.select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: max-content;
  background: var(--bg-primary);
  border-radius: 12px;
  box-shadow: var(--shadow-floating);
  list-style: none;
  padding: var(--spacing-xs);
  margin: 0;
  max-height: 264px;
  overflow-y: auto;
  z-index: 20;
}

.select-menu li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.12s ease;
}

.select-menu li:hover { background: var(--bg-secondary); }

.select-menu li img { width: 22px; height: 22px; border-radius: 4px; }

.select-menu li .abbr { font-weight: 700; }

.select-menu li[aria-selected='true'] { background: rgb(224, 240, 237); }

/* ===== Buttons ===== */
.btn {
  font-family: inherit;
  height: var(--btn-height-m);
  border: none;
  border-radius: var(--btn-radius);
  font-size: 16px;   /* callout1 */
  line-height: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.24s cubic-bezier(0.42, 0, 0.58, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.channel-row {
  display: flex;
  gap: var(--spacing-m);
}

.channel-row .btn { flex: 1; }

.btn-block { width: 100%; }

/* Log in — primary green */
.btn-primary {
  background: var(--green-enabled);
  color: rgb(255, 255, 255);
}

.btn-primary:hover { background: var(--green-hover); }

/* disabled Log in button */
.btn:disabled,
.btn-primary:disabled {
  background: rgb(205, 206, 208);
  color: rgb(98, 99, 100);
  cursor: default;
}

.btn:disabled:hover { background: rgb(205, 206, 208); }

/* spinner (page-styled) */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Method unavailable modal ===== */
.modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(22, 23, 23, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-m);
  z-index: 50;
}

.method-error {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--bg-primary);
  border-radius: 16px;
  box-shadow: var(--shadow-floating);
  padding: 32px 28px 28px;
  text-align: center;
}

.method-error-text {
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
}

/* [hidden] must always win over display rules */
[hidden] { display: none !important; }

/* Separator */
.login-separator {
  text-align: center;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 20px;
  margin: var(--spacing-m) 0;
}

/* Google / Email — floating (white + shadow) */
.login-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.btn-floating {
  width: 100%;
  background: var(--bg-primary);
  box-shadow: var(--shadow-floating);
  color: var(--text-primary);
  margin-bottom: var(--spacing-m);
}

.btn-floating:hover { background: rgb(250, 250, 251); }

.btn-floating .social-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.btn-floating img { display: block; }

/* Terms */
.terms {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 20px;
  margin: var(--spacing-l) 0 var(--spacing-xs);
}

.terms a {
  color: var(--green-hover);
  font-weight: 700;
  text-decoration: none;
}

.terms a:hover { text-decoration: underline; }

/* ===== Small screens ===== */
@media (max-width: 480px) {
  .field-prefix { width: 128px; }
}

/* ===== Desktop — same as glovoapp.com at 960px and up =====
   Typography from their :root overrides for min-width:960px */
@media (min-width: 960px) {
  .site-header { padding: var(--spacing-m) 64px; }
  .site-header .logo { width: 171px; }

  .page-main { padding: 0 0 var(--spacing-l); }

  .login-card { padding: 0 0 var(--spacing-l); }

  /* typography scale-up (their desktop tokens) */
  .login-header { font-size: 37px; line-height: 40px; }  /* text-size-xxl: 37 */
  .login-text { font-size: 16px; line-height: 20px; }    /* text-size-s: 16 */
  .field-label { font-size: 16px; line-height: 20px; }
  .recaptcha-note { font-size: 14px; line-height: 20px; }/* text-size-xs: 14 */
  .btn { font-size: 18px; line-height: 24px; height: 56px; } /* text-size-m: 18 */
  .login-separator { font-size: 18px; line-height: 24px; }
  .terms { font-size: 16px; line-height: 20px; }

  .field-prefix { width: 160px; }
}

/* ===== reCAPTCHA note ===== */
.recaptcha-note {
  margin-top: var(--spacing-l);
  margin-bottom: var(--spacing-l);
  font-size: 12px;   /* caption */
  line-height: 16px;
  font-weight: 400;
  color: var(--text-primary);
}

.recaptcha-note a {
  color: var(--green-hover);
  font-weight: 700;
  text-decoration: none;
}

.recaptcha-note a:hover { text-decoration: underline; }


