/* ===========================================
   AXiVRS ID - Main Stylesheet
   =========================================== */

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* CSS Variables - 宇宙テーマ: #4C2889 → #1E3A8A → #06B6D4 */
:root {
  --bg-primary: #f5f5f7;
  --bg-card: #fff;
  --bg-input: #f9fafb;
  --border-color: #e5e7eb;
  --border-focus: #1E3A8A;
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-label: #374151;
  --link-color: #1E3A8A;
  --shadow-card: 0 20px 60px rgba(0,0,0,0.12);
  --shadow-btn: none;
  --shadow-btn-hover: 0 4px 12px rgba(0,0,0,0.15);
  --glow-opacity: 0;
  --success-color: #10b981;
  --error-color: #ef4444;
}

/* Dark Theme - Cyber */
[data-theme="dark"] {
  --bg-primary: #0a0e1f;
  --bg-card: linear-gradient(180deg, #0d1229 0%, #151a35 100%);
  --bg-input: rgba(26,31,58,0.8);
  --border-color: rgba(6,182,212,0.12);
  --border-focus: #06B6D4;
  --text-primary: #ffffff;
  --text-secondary: #8892B0;
  --text-label: #8892B0;
  --link-color: #22D3EE;
  --shadow-card: none;
  --shadow-btn: none;
  --shadow-btn-hover: 0 8px 32px rgba(6,182,212,0.25);
  --glow-opacity: 0.25;
}

/* Base */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--bg-primary);
  transition: background 0.4s ease;
}

/* Theme Toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.theme-toggle-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.theme-toggle-switch {
  position: relative;
  width: 56px;
  height: 28px;
  background: var(--border-color);
  border-radius: 14px;
  transition: all 0.3s ease;
  padding: 2px;
}

.theme-toggle-switch::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

[data-theme="dark"] .theme-toggle-switch {
  background: linear-gradient(135deg, #4C2889, #1E3A8A, #06B6D4);
}

[data-theme="dark"] .theme-toggle-switch::after {
  left: calc(100% - 26px);
}

.theme-toggle-fixed {
  position: fixed;
  top: 24px;
  right: 24px;
}

.theme-toggle-fixed .theme-toggle-label {
  display: none;
}

/* Card */
.card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

[data-theme="dark"] .card {
  border: 1px solid rgba(6,182,212,0.15);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4C2889, #1E3A8A, #06B6D4);
  border-radius: 24px 24px 0 0;
}

/* Glow Effects - using radial gradients (no blur filter = no Safari issues) */
.glow-orb {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  opacity: var(--glow-opacity);
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.glow-orb.cyan {
  background: radial-gradient(circle, rgba(6,182,212,0.6) 0%, rgba(6,182,212,0) 70%);
  top: -60px;
  right: -60px;
}

.glow-orb.magenta {
  background: radial-gradient(circle, rgba(76,40,137,0.6) 0%, rgba(76,40,137,0) 70%);
  bottom: -60px;
  left: -60px;
}

.content {
  position: relative;
  z-index: 1;
}

/* Logo */
.logo-section {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #4C2889, #1E3A8A, #06B6D4);
  border-radius: 16px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(6,182,212,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo-icon:hover {
  transform: scale(1.05) rotate(3deg);
  box-shadow: 0 12px 28px rgba(6,182,212,0.2);
}

.logo-icon svg {
  width: 32px;
  height: 32px;
  fill: #fff;
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  transition: color 0.4s ease;
}

.logo-text span {
  background: linear-gradient(135deg, #1E3A8A, #06B6D4, #22D3EE);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-subtext {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
  transition: color 0.4s ease;
}

/* Form Elements */
.input-group {
  margin-bottom: 18px;
}

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-label);
  margin-bottom: 8px;
  transition: color 0.4s ease;
}

.input-wrapper {
  position: relative;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 16px;
  padding-left: 44px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 16px;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

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

.input-wrapper input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px rgba(30,58,138,0.1);
}

[data-theme="dark"] .input-wrapper input:focus {
  box-shadow: 0 0 0 4px rgba(6,182,212,0.1);
}

.input-wrapper input.valid {
  border-color: var(--success-color);
}

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

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  fill: var(--text-secondary);
  transition: fill 0.3s ease;
}

.input-wrapper:focus-within .input-icon {
  fill: var(--border-focus);
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #4C2889, #1E3A8A, #06B6D4);
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-btn);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn-hover);
}

.btn-primary:hover::before {
  left: 100%;
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary:disabled:hover::before {
  left: -100%;
}

.btn-outline {
  width: 100%;
  padding: 15px;
  background: transparent;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-outline:hover {
  border-color: var(--border-focus);
  background: rgba(189,0,255,0.05);
}

.btn-outline.danger:hover {
  border-color: var(--error-color);
  color: var(--error-color);
  background: rgba(239, 68, 68, 0.05);
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  margin: 28px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

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

.divider span {
  padding: 0 16px;
}

/* Social Buttons */
.social-btns {
  display: flex;
  gap: 12px;
}

.social-btn {
  flex: 1;
  padding: 13px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.social-btn span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.social-btn .social-icon {
  flex-shrink: 0;
  color: var(--text-primary);
}

.social-btn:hover {
  border-color: var(--border-focus);
  background: rgba(189,0,255,0.05);
}

[data-theme="dark"] .social-btn:hover {
  background: rgba(0,240,255,0.1);
}

/* Links */
.link-text {
  text-align: center;
  margin-top: 28px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.4s ease;
}

.link-text a {
  background: linear-gradient(135deg, #4C2889, #1E3A8A, #06B6D4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  font-weight: 600;
}

.link-text a:hover {
  text-decoration: underline;
}

.back-link {
  text-align: center;
  margin-top: 28px;
}

.back-link a {
  background: linear-gradient(135deg, #4C2889, #1E3A8A, #06B6D4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.back-link a:hover {
  text-decoration: underline;
}

/* Messages */
.error-message {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

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

.success-message {
  display: none;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  color: #059669;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

[data-theme="dark"] .success-message {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* Footer */
.footer {
  margin-top: 32px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.footer p {
  margin: 0;
  line-height: 1.6;
}

.footer-credit {
  margin-top: 2px;
  font-size: 11px;
  opacity: 0.6;
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer a:hover {
  color: var(--link-color);
}

/* Responsive */
@media (max-width: 480px) {
  .card {
    padding: 36px 24px;
  }

  .social-btn span {
    display: none;
  }
}
