/* =============================================
   Calendar OAuth Portal — LightPath AI
   Premium glassmorphism design
   ============================================= */

:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --accent: #8b5cf6;
  --success: #22c55e;
  --error: #ef4444;
  --bg-dark: #0f0f1a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---- Background ---- */
.page-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(99, 102, 241, 0.06) 0%, transparent 40%),
    var(--bg-dark);
}

/* ---- Card ---- */
.card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  text-align: center;
  animation: fadeInUp 0.6s ease-out;
}

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

/* ---- Logo ---- */
.logo-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.logo-icon {
  display: flex;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Typography ---- */
.title {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.subtitle {
  font-size: 0.925rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ---- Buttons ---- */
.buttons {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.9rem 1.5rem;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  transition: opacity 0.25s;
}

.btn:hover::before {
  opacity: 1;
}

.btn-icon {
  flex-shrink: 0;
}

/* Google button */
.btn-google {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.btn-google::before {
  background: rgba(255, 255, 255, 0.04);
}

.btn-google:hover {
  border-color: rgba(66, 133, 244, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(66, 133, 244, 0.15);
}

/* Microsoft button */
.btn-microsoft {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.btn-microsoft::before {
  background: rgba(255, 255, 255, 0.04);
}

.btn-microsoft:hover {
  border-color: rgba(0, 164, 239, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 164, 239, 0.15);
}

/* Disconnect button */
.btn-disconnect {
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-disconnect:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

/* Retry / Primary button */
.btn-retry,
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
}

.btn-retry:hover,
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

/* ---- Request form (home page) ---- */
.request-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.form-input {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  font-size: 0.85rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  text-align: left;
}

/* ---- Trust Signals ---- */
.trust-signals {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---- Connected Email ---- */
.connected-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 10px;
  font-size: 0.875rem;
  color: var(--primary-light);
  margin-top: 0.5rem;
}

/* ---- Success Animation ---- */
.success-icon {
  margin-bottom: 1.5rem;
}

.animate-check .circle-stroke {
  stroke-dasharray: 226;
  stroke-dashoffset: 226;
  animation: drawCircle 0.8s ease-out 0.2s forwards;
}

.animate-check .check-path {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: drawCheck 0.5s ease-out 0.8s forwards;
}

@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

/* ---- Error Icon ---- */
.error-icon {
  margin-bottom: 1.5rem;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .card {
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }

  .title {
    font-size: 1.4rem;
  }

  .trust-signals {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }
}
