/* CSS Variables */
:root {
  --primary: #FFD100;
  --primary-hover: #E6BC00;
  --primary-light: rgba(255, 209, 0, 0.1);
  --dark: #1A1A2E;
  --dark-secondary: #2D2D44;
  --text-primary: #1A1A2E;
  --text-secondary: #5C5C70;
  --text-muted: #8E8E9A;
  --border: #E5E5EB;
  --border-focus: #FFD100;
  --background: #F7F7FA;
  --white: #FFFFFF;
  --error: #DC3545;
  --error-light: rgba(220, 53, 69, 0.1);
  --success: #28A745;
  --shadow-sm: 0 1px 3px rgba(26, 26, 46, 0.08);
  --shadow-md: 0 4px 12px rgba(26, 26, 46, 0.1);
  --shadow-lg: 0 8px 30px rgba(26, 26, 46, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* Layout */
.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  padding: 1.5rem 2rem;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 36px;
  height: 36px;
}

.logo-text {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.02em;
}

/* Main Content */
.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

/* Card */
.card {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideUp 0.5s ease-out;
}

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

.card-header {
  padding: 2.5rem 2.5rem 0;
  text-align: center;
}

.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--primary-light);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 1.5rem;
}

.lock-icon {
  width: 14px;
  height: 14px;
  stroke: var(--dark);
}

.card-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Form */
.form {
  padding: 2rem 2.5rem;
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
  pointer-events: none;
  transition: stroke 0.2s ease;
}

.input-wrapper input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
}

.input-wrapper input::placeholder {
  color: var(--text-muted);
}

.input-wrapper input:hover {
  border-color: #D0D0D8;
}

.input-wrapper input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  stroke: var(--dark);
}

.input-wrapper input.error {
  border-color: var(--error);
  background: var(--error-light);
}

.input-wrapper input.error:focus {
  box-shadow: 0 0 0 4px var(--error-light);
}

.error-message {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--error);
  min-height: 1.25rem;
}

/* Submit Button */
.submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--dark);
  background: var(--primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.submit-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.submit-btn:disabled {
  cursor: not-allowed;
  opacity: 0.9;
}

.btn-arrow {
  width: 20px;
  height: 20px;
  stroke: var(--dark);
  transition: transform 0.2s ease;
}

.submit-btn:hover:not(:disabled) .btn-arrow {
  transform: translateX(4px);
}

.btn-loader {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-loader[hidden] {
  display: none;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--dark);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Card Footer */
.card-footer {
  padding: 1.25rem 2.5rem 2rem;
  text-align: center;
}

.card-footer p {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Footer */
.footer {
  padding: 1.5rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--white);
}

.footer p {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 480px) {
  .header {
    padding: 1rem 1.25rem;
  }

  .main {
    padding: 2rem 1rem;
    align-items: flex-start;
  }

  .card {
    border-radius: var(--radius-md);
  }

  .card-header {
    padding: 2rem 1.5rem 0;
  }

  .card-header h1 {
    font-size: 1.5rem;
  }

  .form {
    padding: 1.5rem;
  }

  .card-footer {
    padding: 1rem 1.5rem 1.5rem;
  }
}

/* Focus visible for keyboard navigation */
.submit-btn:focus-visible {
  outline: 2px solid var(--dark);
  outline-offset: 2px;
}

input:focus-visible {
  outline: none;
}

/* Subtle background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(255, 209, 0, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(26, 26, 46, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* ====================== */
/* Desktop Notice Styles  */
/* ====================== */

.desktop-notice {
  max-width: 480px;
}

.desktop-notice .card-header {
  padding-bottom: 1.5rem;
}

.device-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: var(--primary-light);
  border-radius: 50%;
  margin-bottom: 1.5rem;
}

.device-icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--dark);
}

.notice-content {
  padding: 0 2.5rem 1.5rem;
}

.instruction {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--background);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.instruction:last-of-type {
  margin-bottom: 0;
}

.instruction-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.instruction-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--dark);
}

.instruction p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.instruction strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* QR Code */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.qr-code {
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-code canvas {
  border-radius: var(--radius-sm);
}

.qr-url {
  margin-top: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  background: var(--primary-light);
  border-radius: 100px;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Desktop notice footer */
.desktop-notice .card-footer {
  background: var(--background);
  border-top: 1px solid var(--border);
  padding: 1.25rem 2.5rem;
}
