/* ============================================================
   Auth Pages — Quotation2 Design Language
   White/gray with subtle orange accents, modern typography
   ============================================================ */

/* --- Tokens --- */
:root {
  --auth-orange: #E8792B;
  --auth-orange-hover: #d46a1f;
  --auth-orange-light: #FDF4EE;
  --auth-gray-900: #111827;
  --auth-gray-700: #374151;
  --auth-gray-500: #6B7280;
  --auth-gray-400: #9CA3AF;
  --auth-gray-300: #D1D5DB;
  --auth-gray-200: #E5E7EB;
  --auth-gray-100: #F3F4F6;
  --auth-gray-50: #F9FAFB;
  --auth-white: #FFFFFF;
  --auth-radius: 8px;
  --auth-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --auth-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
}

/* --- Reset --- */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* --- Full-page layout --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  background: var(--auth-gray-50);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* --- Left branding panel --- */
.auth-brand {
  flex: 0 0 420px;
  background: var(--auth-gray-900);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -80px;
  right: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: var(--auth-orange);
  opacity: 0.08;
}

.auth-brand-logo {
  width: 140px;
}

.auth-brand-text {
  color: var(--auth-white);
}

.auth-brand-text h2 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}

.auth-brand-text p {
  font-size: 15px;
  color: var(--auth-gray-400);
  line-height: 1.6;
  margin: 0;
}

.auth-brand-footer {
  font-size: 12px;
  color: var(--auth-gray-500);
}

/* --- Right form area --- */
.auth-form-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-card form {
  width: 100%;
}

.auth-card h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--auth-gray-900);
  margin-bottom: 4px;
}

.auth-card .auth-subtitle {
  font-size: 14px;
  color: var(--auth-gray-500);
  margin-bottom: 32px;
}

/* --- Form fields --- */
.auth-field {
  margin-bottom: 20px;
  width: 100%;
}

.auth-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-gray-700);
  margin-bottom: 6px;
}

.auth-field label .required {
  color: var(--auth-orange);
  margin-left: 2px;
}

.auth-field .auth-input-wrap {
  position: relative;
  width: 100%;
}

.auth-field input.auth-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 40px 10px 14px;
  font-size: 14px;
  color: var(--auth-gray-900);
  background: var(--auth-white);
  border: 1.5px solid var(--auth-gray-300);
  border-radius: var(--auth-radius);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-field input.auth-input::placeholder {
  color: var(--auth-gray-400);
}

.auth-field input.auth-input:focus {
  border-color: var(--auth-orange);
  box-shadow: 0 0 0 3px rgba(232, 121, 43, 0.1);
}

.auth-field input.auth-input.is-invalid {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* --- Password toggle --- */
.auth-pass-toggle {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--auth-gray-400);
  font-size: 16px;
  line-height: 1;
}

.auth-pass-toggle:hover {
  color: var(--auth-gray-700);
}

/* --- Checkbox --- */
.auth-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 13px;
}

.auth-check-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--auth-gray-700);
  cursor: pointer;
  margin: 0;
  font-weight: 400;
}

.auth-check-row input[type="checkbox"] {
  display: none;
}

.auth-check-row .auth-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--auth-gray-300);
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.auth-check-row .auth-checkbox svg {
  width: 12px;
  height: 12px;
  stroke: var(--auth-white);
  stroke-width: 3;
  fill: none;
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  transition: stroke-dashoffset 0.3s ease 0.1s;
}

.auth-check-row input[type="checkbox"]:checked + .auth-checkbox {
  background: var(--auth-orange);
  border-color: var(--auth-orange);
  animation: checkbox-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.auth-check-row input[type="checkbox"]:checked + .auth-checkbox svg {
  stroke-dashoffset: 0;
}

@keyframes checkbox-pop {
  0% { transform: scale(1); }
  30% { transform: scale(0.8); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.auth-check-row a,
a.auth-link {
  color: var(--auth-orange);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.auth-check-row a:hover,
a.auth-link:hover {
  color: var(--auth-orange-hover);
  text-decoration: underline;
}

/* --- Primary button --- */
.auth-btn {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--auth-white);
  background: var(--auth-orange);
  border: none;
  border-radius: var(--auth-radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  position: relative;
}

.auth-btn:hover {
  background: var(--auth-orange-hover);
}

.auth-btn:active {
  transform: scale(0.99);
}

.auth-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-btn .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

.auth-btn.loading .spinner {
  display: inline-block;
}

.auth-btn.loading .btn-text {
  opacity: 0.8;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Error / success messages --- */
.auth-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--auth-radius);
  padding: 10px 14px;
  font-size: 13px;
  color: #DC2626;
  margin-bottom: 20px;
}

.auth-success {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--auth-radius);
  padding: 10px 14px;
  font-size: 13px;
  color: #16A34A;
  margin-bottom: 20px;
}

.auth-field .field-error {
  font-size: 12px;
  color: #DC2626;
  margin-top: 4px;
}

/* --- Password requirements hint --- */
.auth-pass-hint {
  font-size: 11px;
  color: var(--auth-gray-500);
  margin-top: 6px;
  line-height: 1.5;
}

/* --- Helper text --- */
.auth-helper {
  background: var(--auth-orange-light);
  border-radius: var(--auth-radius);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--auth-gray-700);
  margin-bottom: 24px;
  line-height: 1.5;
}

.auth-helper strong {
  color: var(--auth-orange);
}

/* --- Back link --- */
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--auth-gray-500);
  text-decoration: none;
  margin-top: 20px;
  transition: color 0.15s;
}

.auth-back:hover {
  color: var(--auth-orange);
}

/* --- Orange accent bar --- */
.auth-accent-bar {
  height: 3px;
  background: var(--auth-orange);
  border-radius: 2px;
  margin-bottom: 32px;
  width: 48px;
}

/* --- Mascot animations --- */
.auth-mascot {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 32px 0 16px;
  background: radial-gradient(circle at 50% 80%, rgba(247,123,55,0.12) 0%, transparent 65%);
  border-radius: 50%;
}

.auth-mascot .char-body {
  animation: char-bounce 2s ease-in-out infinite;
}

.auth-mascot .char-eyes {
  transform-origin: center;
  animation: blink 3s ease-in-out infinite;
}

.auth-mascot .char-arm {
  transform-origin: 50% 0%;
  animation: sway 1.5s ease-in-out infinite;
}

.auth-mascot .mascot-striped-scarf {
  transform-origin: 60px 76px;
  animation: mascot-scarf-flutter 2.2s ease-in-out infinite;
}

.auth-mascot .floating-paper {
  animation: float-paper 2.5s ease-out infinite;
}

.auth-mascot .floating-paper:nth-child(2) {
  animation-delay: 0.8s;
}

.auth-mascot .floating-paper:nth-child(3) {
  animation-delay: 1.6s;
}

@keyframes char-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes blink {
  0%, 42%, 46%, 100% { transform: scaleY(1); }
  44% { transform: scaleY(0.1); }
}

@keyframes sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(5deg); }
}

@keyframes mascot-scarf-flutter {
  0%, 100% { transform: rotate(-1.2deg); }
  50% { transform: rotate(2deg); }
}

@keyframes float-paper {
  0% { opacity: 0; transform: translateY(0) rotate(0deg); }
  20% { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-30px) rotate(15deg); }
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .auth-brand {
    display: none;
  }

  .auth-form-area {
    padding: 32px 24px;
  }

  .auth-card {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .auth-form-area {
    padding: 24px 16px;
  }

  .auth-card h1 {
    font-size: 20px;
  }
}
