/* ============================================================
   DUNONG ARCHIVE - Login Page Styles
   ============================================================ */

.login-page {
  background: url('../assets/images/backgroundSystem.png') center center / cover no-repeat;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container { 
  width: 100%; 
  max-width: 440px; 
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: fadeInUp 0.4s ease;
}

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

.login-header {
  text-align: center;
  padding: 32px 24px 20px;
  background: linear-gradient(180deg, #1A365D 0%, #1E3A5F 100%);
}

.login-icon { 
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 12px; 
}

.login-title { 
  color: #fff; 
  font-size: 1.4rem; 
  margin-bottom: 4px; 
  word-break: break-word;
}

.login-subtitle { 
  color: rgba(255,255,255,0.7); 
  font-size: 0.85rem; 
}

.login-body { 
  padding: 28px 24px 20px; 
}

.security-notice {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.sso-buttons { 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
  margin-bottom: 8px; 
}

.sso-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: all var(--transition);
}

.sso-btn:hover { 
  border-color: var(--primary); 
  box-shadow: var(--shadow-sm); 
}

.sso-icon-img {
  width: 20px;
  height: 20px;
}

/* ── Terms & Privacy agreement ──
   The checkbox sits below the Turnstile widget and keeps its
   plain sentence. The actual Terms / Privacy / Data Retention
   links moved to the login footer in v1.4.7 (see .footer-links
   below).

   align-items: center vertically centers the text label with the
   checkbox - previously the text was top-aligned (align-items:
   flex-start) which made the text sit higher than the checkbox
   when it wrapped to multiple lines. */
.terms-agreement {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 16px;
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
}

.terms-agreement input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

.terms-agreement span {
  flex: 1;
}

/* ── Terms / Privacy modal ──
   Blank for now - content will be added later. Same dark header
   as the rest of the teacher modals for visual consistency. */
.terms-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeInUp 0.25s ease;
}

.terms-modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

.terms-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, #1A365D 0%, #1E3A5F 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.terms-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-family: var(--font-display);
  color: #fff;
}

.terms-modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #fff;
  transition: color var(--transition);
  padding: 0;
  line-height: 1;
}

.terms-modal-close:hover {
  color: #ffcccc;
}

.terms-modal-body {
  padding: 28px 24px;
  min-height: 180px;
}

.terms-modal-placeholder {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 40px 0;
}

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

.login-footer { 
  text-align: center; 
  padding: 16px 24px 28px; 
  border-top: 1px solid var(--border-light); 
  font-size: 0.75rem; 
  color: var(--text-muted); 
}

/* v1.4.7: legal links live in the footer - Terms and Conditions,
   Privacy Policy, and Data Retention & Deletion. Each opens the
   shared legal modal (js/TermsAndConditionAndPrivacyPolicy.js).
   v1.4.8: links sit BELOW the ownership sentence, so the margin
   moved from bottom to top. */
.login-footer .footer-links {
  margin: 8px 0 0;
  font-size: 0.78rem;
  line-height: 1.8;
}

.login-footer .footer-links a {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 500;
}

.login-footer .footer-links a:hover {
  color: var(--primary-dark);
}

.login-footer .footer-sep {
  margin: 0 6px;
  color: var(--text-muted);
}

.turnstile { 
  background: var(--bg-secondary); 
  border-radius: var(--radius-sm); 
  padding: 12px 16px; 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  justify-content: center; 
  margin-bottom: 20px; 
}

.turnstile-check { 
  width: 24px; 
  height: 24px; 
  border-radius: 50%; 
  background: #38A169; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  color: #fff; 
  font-size: 0.75rem; 
}
/* Real Cloudflare Turnstile widget container.
   "normal" mode renders as a wide horizontal bar (not a square),
   so we just center it and let it use its natural width/height -
   no more scale() hack needed.
   v1.4.7: top margin increased 4px -> 16px so the widget gets
   clear breathing room below the "Continue with Google" button
   (8px button margin + 16px here = 24px gap). */
.cf-turnstile {
  display: flex;
  justify-content: center;
  margin: 16px 0 8px;
  min-height: 65px;
}

.cf-turnstile iframe {
  width: 100% !important;
}

/* Disabled SSO buttons (before Turnstile passes + before Terms
   checkbox is checked) */
.sso-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.turnstile-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: -4px 0 16px;
}
