/*
 * gmail-signin.css
 * Extracted and converted from gmailSignInStyles.ts (React CSS-in-JS → static CSS).
 * All design tokens preserved exactly.
 */

/* ─── Design tokens ─────────────────────────────────────────────────────── */
:root {
  --gs-font:               'Roboto', 'Google Sans', 'Noto Sans', Arial, sans-serif;
  --gs-bg:                 #f0f4f9;
  --gs-card:               #fff;
  --gs-text:               #1f1f1f;
  --gs-text-secondary:     #444746;
  --gs-link:               #0b57d0;
  --gs-link-hover:         #0842a0;
  --gs-border:             #747775;
  --gs-border-focus:       #0b57d0;
  --gs-border-error:       #b3261e;
  --gs-btn-primary:        #0b57d0;
  --gs-btn-primary-dis:    #abc7f5;
  --gs-chip-border:        #747775;
}

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

body, html { margin: 0; padding: 0; }

.gs-body {
  font-family: var(--gs-font);
  background: var(--gs-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ─── Page overlay (centering wrapper for the card) ─────────────────────── */
.gs-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 48px 16px 10px;
}

/* ─── Card ───────────────────────────────────────────────────────────────── */
.gs-card {
  width: 100%;
  max-width: 1040px;
  min-height: 384px;
  background: var(--gs-card);
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  position: relative;
}

/* ─── Panels ─────────────────────────────────────────────────────────────── */
.gs-left {
  flex: 1 1 50%;
  padding: 24px 36px 36px 36px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.gs-right {
  flex: 1 1 50%;
  padding: 24px 36px 36px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 340px;
}

/* ─── Typography ─────────────────────────────────────────────────────────── */
.gs-title {
  margin: 24px 0 0 0;
  font-size: 42px;
  line-height: 1.3;
  font-weight: 400;
  color: var(--gs-text);
}

.gs-subtitle {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: var(--gs-text);
  max-width: 420px;
}

.gs-section-title {
  margin: 0;
  margin-top: 30px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  color: var(--gs-text);
  font-family: var(--gs-font);
}

/* ─── Links / text buttons ───────────────────────────────────────────────── */
.gs-link {
  color: var(--gs-link);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font-family: var(--gs-font);
}
.gs-link:hover { color: var(--gs-link-hover); }

.gs-text-btn {
  color: var(--gs-link);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--gs-font);
  border: none;
  background: none;
  padding: 0 8px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
}
.gs-text-btn:hover { color: var(--gs-link-hover); }

/* ─── Primary button ─────────────────────────────────────────────────────── */
.gs-btn-primary {
  min-width: 80px;
  height: 40px;
  padding: 0 24px;
  border-radius: 20px;
  border: none;
  background: var(--gs-btn-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--gs-font);
  cursor: pointer;
}
.gs-btn-primary:disabled {
  background: var(--gs-btn-primary-dis);
  cursor: default;
}

/* ─── Actions row ────────────────────────────────────────────────────────── */
.gs-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  width: 100%;
}
.gs-actions-end {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

/* ─── Outlined floating-label input ─────────────────────────────────────── */
.gs-input-wrap {
  position: relative;
  border: 1px solid var(--gs-border);
  border-radius: 4px;
  padding: 13px 15px;
  margin-top: 4px;
  transition: border-color 0.15s ease;
  display: flex;
  align-items: center;
}
.gs-input-wrap.focused      { border-color: var(--gs-border-focus); }
.gs-input-wrap.has-error    { border-color: var(--gs-border-error); }

.gs-label {
  position: absolute;
  left: 15px;
  top: 13px;
  font-size: 16px;
  line-height: 24px;
  color: var(--gs-text-secondary);
  background: var(--gs-card);
  padding: 0;
  pointer-events: none;
  transition: top 0.15s ease, font-size 0.15s ease, color 0.15s ease, left 0.15s ease;
}
.gs-label.floated {
  top: -8px;
  left: 11px;
  font-size: 12px;
  line-height: 16px;
  padding: 0 4px;
}
.gs-label.floated.focused      { color: var(--gs-border-focus); }
.gs-label.floated.has-error    { color: var(--gs-border-error); }
.gs-label.has-error            { color: var(--gs-border-error); }

.gs-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 16px;
  line-height: 24px;
  color: var(--gs-text);
  background: transparent;
  font-family: var(--gs-font);
  padding: 0;
}

.gs-input-prefix {
  font-size: 16px;
  line-height: 24px;
  color: var(--gs-text);
  font-family: var(--gs-font);
  margin-right: 4px;
  user-select: none;
  flex-shrink: 0;
}

/* ─── Form error ─────────────────────────────────────────────────────────── */
.gs-form-error {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 16px;
  color: var(--gs-border-error);
}

/* ─── Guest text ─────────────────────────────────────────────────────────── */
.gs-guest-text {
  margin-top: 48px;
  font-size: 14px;
  line-height: 20px;
  color: var(--gs-text-secondary);
}

/* ─── Checkbox label ─────────────────────────────────────────────────────── */
.gs-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  line-height: 20px;
  color: var(--gs-text);
  font-family: var(--gs-font);
  cursor: pointer;
}

/* ─── Email chip ─────────────────────────────────────────────────────────── */
.gs-email-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--gs-chip-border);
  border-radius: 20px;
  padding: 4px 12px 4px 4px;
  background: var(--gs-card);
  max-width: 300px;
  font-family: var(--gs-font);
  color: var(--gs-text);
}
.gs-email-chip__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gs-btn-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gs-email-chip__text {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
.gs-email-chip__arrow {
  color: var(--gs-text-secondary);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ─── Method picker ──────────────────────────────────────────────────────── */
.gs-method-heading {
  margin: 0;
  font-size: 20px;
  line-height: 24px;
  font-weight: 400;
  color: var(--gs-text);
  font-family: var(--gs-font);
}
.gs-method-btn {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  text-align: left;
  padding: 16px 12px;
  border: none;
  border-bottom: 1px solid var(--gs-bg);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--gs-font);
}
.gs-method-btn--last { border-bottom: none; }
.gs-method-btn:hover {
  background: #f5f8ff;
  border-radius: 8px;
}
.gs-method-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  color: var(--gs-link);
}
.gs-method-labels {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gs-method-label {
  font-size: 14px;
  line-height: 20px;
  color: var(--gs-text);
}
.gs-method-sublabel {
  font-size: 12px;
  line-height: 16px;
  color: var(--gs-text-secondary);
}

/* ─── Device prompt ──────────────────────────────────────────────────────── */
.gs-device-number {
  font-size: 72px;
  font-weight: 400;
  line-height: 1;
  color: var(--gs-text);
  font-family: var(--gs-font);
  text-align: center;
  margin-top: 56px;
  margin-bottom: 24px;
}
.gs-device-instruction {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 20px;
  color: var(--gs-text-secondary);
  font-family: var(--gs-font);
}

/* ─── Loading overlay + progress bar ────────────────────────────────────── */
.gs-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(255,255,255,0.58);
  backdrop-filter: blur(0.7px);
  -webkit-backdrop-filter: blur(1px);
  border-radius: 28px;
  pointer-events: all;
}
.gs-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 28px 28px 0 0;
  background: #e8eaed;
  overflow: hidden;
  z-index: 6;
}
.gs-progress-bar__track1 {
  position: absolute;
  top: 0;
  height: 100%;
  background: #1a73e8;
  animation: gmail-progress-bar 1.8s cubic-bezier(0.4,0,0.2,1) infinite;
}
.gs-progress-bar__track2 {
  position: absolute;
  top: 0;
  height: 100%;
  background: #1a73e8;
  animation: gmail-progress-bar2 1.8s cubic-bezier(0.4,0,0.2,1) 0.9s infinite;
}

@keyframes gmail-progress-bar {
  0%   { left: -45%; width: 45%; }
  50%  { left:  60%; width: 45%; }
  100% { left: 110%; width: 45%; }
}
@keyframes gmail-progress-bar2 {
  0%   { left: -80%; width: 25%; }
  60%  { left: 110%; width: 25%; }
  100% { left: 110%; width: 25%; }
}

/* ─── Hide overlay/bar until loading state is applied ───────────────────── */
.gs-loading-overlay,
.gs-progress-bar {
  display: none;
}
.gs-card--loading .gs-loading-overlay,
.gs-card--loading .gs-progress-bar {
  display: block;
}

/* ─── Responsive — single column on mobile ──────────────────────────────── */
@media (max-width: 720px) {
  .gmail-signin-card {
    flex-direction: column;
    max-width: 450px;
    min-height: auto !important;
  }
  .gmail-signin-left,
  .gmail-signin-right {
    flex: 1 1 auto !important;
    padding: 24px 24px 0 !important;
    min-height: auto !important;
  }
  .gmail-signin-right { padding-bottom: 24px !important; }
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.gs-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 12px;
  font-size: 12px;
  color: #5f6368;
}
.gs-footer__lang { position: relative; }
.gs-footer__lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid #dadce0;
  border-radius: 4px;
  padding: 6px 12px;
  color: #5f6368;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.gs-footer__lang-btn:hover { background: #f1f3f4; }
.gs-footer__lang-menu {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  background: white;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  min-width: 160px;
  list-style: none;
  margin: 0;
  padding: 8px 0;
  z-index: 100;
}
.gs-footer__lang-menu li[aria-selected="true"] a { font-weight: 600; }
.gs-footer__lang-menu a {
  display: block;
  padding: 10px 16px;
  color: #202124;
  text-decoration: none;
  font-size: 14px;
}
.gs-footer__lang-menu a:hover { background: #f1f3f4; }
.gs-footer__links { display: flex; gap: 32px; }
.gs-footer__links a { color: #5f6368; text-decoration: none; }
.gs-footer__links a:hover { text-decoration: underline; }
