@import url("font.css");

* { box-sizing: border-box; }
/* ==========================================================================
   Otis - Authentication UI Stylesheet (login.php)
   ========================================================================== */

html,
body {
  height: auto !important;
  min-height: 100vh !important;
  overflow-y: auto !important;
}

body {
  background: radial-gradient(circle at 50% 0%, #e0f2fe 0%, #f1f5f9 55%, #e2e8f0 100%);
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1.5rem;
  font-family: var(--font-family-base);
  transition: background 0.25s ease, color 0.25s ease;
  position: relative;
}

.theme-toggle-fixed {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  transition: all 0.2s ease;
}

.theme-toggle-fixed:hover {
  background: #ffffff;
  color: #0f172a;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.theme-toggle__icon {
  display: inline-flex;
  align-items: center;
}

.theme-icon-sun {
  display: none;
}

body[data-theme="dark"] .theme-icon-moon {
  display: none;
}

body[data-theme="dark"] .theme-icon-sun {
  display: inline-flex;
}

.auth-container {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 2.5rem 2.25rem 2rem;
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.1), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.auth-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0284c7 0%, #2563eb 50%, #0d9488 100%);
}

.auth-header {
  text-align: center;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.auth-brand img {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 2px 6px rgba(2, 132, 199, 0.25));
}

.auth-brand-title {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 60%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.auth-tagline {
  margin: 0.45rem 0 0;
  font-size: 0.825rem;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.02em;
}

.auth-body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1.5rem;
}

.auth-tab {
  flex: 1;
  padding: 0.65rem 0;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.auth-tab--active {
  color: #0284c7;
  border-bottom-color: #0284c7;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.4rem;
}

.form-group input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm, 0.375rem);
  color: #0f172a;
  font-size: 0.9rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, background-color 0.2s;
}

.form-group input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
  background: #ffffff;
}

.form-hint {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.35rem;
}

.btn-submit {
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md, 0.5rem);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
  transition: all 0.2s ease;
  margin-top: 0.5rem;
  box-sizing: border-box;
}

.btn-submit:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.5);
  transform: translateY(-1px);
}

.btn-submit--link {
  display: inline-block;
  text-decoration: none;
  width: auto;
  padding: 0.6rem 1.5rem;
}

.auth-actions {
  margin-top: 1rem;
  text-align: center;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm, 0.375rem);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.alert--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.alert--success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #059669;
}

/* ==========================================
   ダークモード（data-theme="dark" 時）
   ========================================== */
body[data-theme="dark"] {
  background: radial-gradient(circle at 50% 0%, #131d33 0%, #0b1120 70%);
  color: #f1f5f9;
}

body[data-theme="dark"] .theme-toggle-fixed {
  background: rgba(30, 41, 59, 0.9);
  border-color: #334155;
  color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .theme-toggle-fixed:hover {
  background: #27354f;
  color: #ffffff;
  border-color: #475569;
}

body[data-theme="dark"] .auth-container {
  background: #131d33;
  border-color: #233354;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

body[data-theme="dark"] .auth-header {
  border-bottom-color: #1e293b;
}

body[data-theme="dark"] .auth-brand img {
  filter: drop-shadow(0 2px 8px rgba(56, 189, 248, 0.4));
}

body[data-theme="dark"] .auth-brand-title {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 60%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body[data-theme="dark"] .auth-tagline {
  color: #94a3b8;
}

body[data-theme="dark"] .auth-tabs {
  border-bottom-color: #233354;
}

body[data-theme="dark"] .auth-tab {
  color: #94a3b8;
}

body[data-theme="dark"] .auth-tab--active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
}

body[data-theme="dark"] .form-group label {
  color: #cbd5e1;
}

body[data-theme="dark"] .form-group input {
  background: #0d1527;
  border-color: #233354;
  color: #f1f5f9;
}

body[data-theme="dark"] .form-group input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

body[data-theme="dark"] .form-hint {
  color: #94a3b8;
}

body[data-theme="dark"] .alert--error {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

body[data-theme="dark"] .alert--success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

/* ==========================================
   Google ログイン専用UI
   ========================================== */
.google-login-title {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #334155;
  text-align: center;
  letter-spacing: 0.01em;
}

body[data-theme="dark"] .google-login-title {
  color: #e2e8f0;
}

.google-login-button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 44px;
  margin: 0.25rem 0 0.5rem;
}

.google-login-button button {
  padding: 0.65rem 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.google-login-status {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #64748b;
  text-align: center;
  line-height: 1.5;
}

body[data-theme="dark"] .google-login-status {
  color: #94a3b8;
}

.google-login-status--error {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  border-radius: 0.5rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-weight: 500;
}

body[data-theme="dark"] .google-login-status--error {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.btn-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.25rem;
  margin-top: 0.25rem;
  background: #f8fafc;
  color: #0284c7;
  border: 1px solid #bae6fd;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-retry:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

body[data-theme="dark"] .btn-retry {
  background: #1e293b;
  border-color: #334155;
  color: #38bdf8;
}

body[data-theme="dark"] .btn-retry:hover {
  background: #27354f;
  border-color: #475569;
  color: #7dd3fc;
}

.auth-footer {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
}

body[data-theme="dark"] .auth-footer {
  border-top-color: #1e293b;
  color: #64748b;
}

.u-hidden { display: none !important; }
