@import url('./mobile-first.css');

/* ============================================================
   assets/css/login.css
   Premium login page – matches Sangkhlaburi index.html theme
   Colors: #5B8DBF (primary) / #1E4A6B (dark) / #D4AF37 (gold)
   Font: Prompt (same as site)
   ============================================================ */

/* --- Reset & Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Prompt', sans-serif;
  background: linear-gradient(180deg, #EBF5FF 0%, #F5FAFF 55%, #FFFFFF 100%);
  color: #1A2332;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Particle Canvas -------------------------------------- */
#login-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* --- Page Layout ------------------------------------------ */
.login-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  gap: 20px;
}

/* --- Brand / Logo ----------------------------------------- */
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 4px;
  animation: fadeSlideDown 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-logo {
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(91,141,191,0.3));
}

.login-brand-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1E4A6B;
  letter-spacing: 0.5px;
}

/* --- Card ------------------------------------------------- */
.login-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(91, 141, 191, 0.18);
  border-radius: 28px;
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(26, 35, 50, 0.10),
              0 0 0 1px rgba(91,141,191,0.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeSlideUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* --- Card Badge ------------------------------------------- */
.login-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #EBF5FF, #D6EDFF);
  color: #1E4A6B;
  border: 1px solid rgba(91,141,191,0.25);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  align-self: flex-start;
}

/* --- Heading ---------------------------------------------- */
.login-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #1E4A6B;
  line-height: 1.2;
}

.login-subtitle {
  font-size: 0.92rem;
  color: #6B7280;
  line-height: 1.6;
  margin-top: -8px;
}

/* --- Google Button ---------------------------------------- */
.btn-google-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  background: #fff;
  border: 1.5px solid rgba(91,141,191,0.25);
  border-radius: 14px;
  font-family: 'Prompt', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1A2332;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(26,35,50,0.06);
}

.btn-google-primary:hover {
  background: #F5F9FD;
  border-color: #5B8DBF;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(91,141,191,0.15);
}

.google-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* --- Divider ---------------------------------------------- */
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #9CA3AF;
  font-size: 0.82rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(91,141,191,0.15);
}

/* --- Input Group ------------------------------------------ */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-group {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #5B8DBF;
  font-size: 0.9rem;
  pointer-events: none;
}

.login-input {
  width: 100%;
  padding: 13px 42px 13px 40px;
  background: #F5F9FD;
  border: 1.5px solid rgba(91,141,191,0.2);
  border-radius: 12px;
  font-family: 'Prompt', sans-serif;
  font-size: 0.95rem;
  color: #1A2332;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.login-input::placeholder { color: #9CA3AF; }

.login-input:focus {
  border-color: #5B8DBF;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(91,141,191,0.12);
}

/* --- Show/hide password ----------------------------------- */
.btn-toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #9CA3AF;
  padding: 4px;
  transition: color 0.2s;
}

.btn-toggle-pw:hover { color: #5B8DBF; }

/* --- Submit Button ---------------------------------------- */
.btn-login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #5B8DBF 0%, #1E4A6B 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: 'Prompt', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 6px 20px rgba(91,141,191,0.35);
  margin-top: 4px;
}

.btn-login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(91,141,191,0.45);
}

.btn-login-submit:active { transform: translateY(0); }

/* --- Message area ----------------------------------------- */
.login-msg {
  min-height: 1.4rem;
  font-size: 0.88rem;
  border-radius: 10px;
  padding: 0;
  text-align: center;
  transition: all 0.3s ease;
}

.login-msg.error {
  background: rgba(255,71,87,0.08);
  border: 1px solid rgba(255,71,87,0.25);
  color: #e53e3e;
  padding: 10px 14px;
}

.login-msg.success {
  background: rgba(46,213,115,0.08);
  border: 1px solid rgba(46,213,115,0.3);
  color: #2f855a;
  padding: 10px 14px;
}

/* --- Toggle text ------------------------------------------ */
.login-toggle-text {
  font-size: 0.88rem;
  color: #6B7280;
  text-align: center;
  line-height: 1.6;
}

.login-toggle-text a {
  color: #5B8DBF;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s;
  margin-left: 4px;
}

.login-toggle-text a:hover { color: #1E4A6B; text-decoration: underline; }

/* --- Back link -------------------------------------------- */
.login-back-link {
  font-size: 0.85rem;
}

.login-back-link a {
  color: #9CA3AF;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.login-back-link a:hover { color: #5B8DBF; }

/* --- Animations ------------------------------------------- */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}


.oauth-browser-hint {
  margin-top: -8px;
  color: #6B7280;
  font-size: 0.76rem;
  line-height: 1.55;
  text-align: center;
}

.oauth-browser-notice {
  padding: 14px;
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: 14px;
  background: #FFFBEB;
  color: #713F12;
  outline: none;
}

.oauth-browser-notice[hidden],
.oauth-browser-action[hidden] {
  display: none;
}

.oauth-browser-notice:focus-visible {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.oauth-browser-notice__heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: #92400E;
  font-size: 0.92rem;
}

.oauth-browser-notice p {
  font-size: 0.8rem;
  line-height: 1.6;
}

.oauth-browser-notice small {
  display: block;
  margin-top: 9px;
  color: #78716C;
  font-size: 0.72rem;
  line-height: 1.5;
}

.oauth-browser-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}

.oauth-browser-actions.oauth-browser-actions--single {
  grid-template-columns: 1fr;
}

.oauth-browser-action {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(146, 64, 14, 0.25);
  border-radius: 11px;
  background: #FFFFFF;
  color: #78350F;
  font-family: 'Prompt', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.oauth-browser-action--primary {
  border-color: #1D4ED8;
  background: #1D4ED8;
  color: #FFFFFF;
}

@media (max-width: 480px) {
  .oauth-browser-actions {
    grid-template-columns: 1fr;
  }
}

/* --- Mobile ------------------------------------------------ */
@media (max-width: 480px) {
  .login-card {
    padding: 28px 20px;
    border-radius: 22px;
  }
  .login-title { font-size: 1.5rem; }
}
