@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(180deg, #F2F2F7 0%, #E5E5EA 100%);
  color: #1C1C1E;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Auth pages */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.08);
}

.auth-icon {
  width: 60px; height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, #007AFF, #0055D4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: white;
  font-size: 28px;
}

.auth-title {
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 14px;
  color: rgba(0,0,0,0.5);
  text-align: center;
  margin-bottom: 24px;
}

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: rgba(0,0,0,0.5);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(0,0,0,0.1);
  background: rgba(0,0,0,0.02);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: #007AFF;
}

.btn {
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #007AFF, #0055D4);
  color: white;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.1s;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; }

.btn-ghost {
  background: none;
  color: #007AFF;
  border: none;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  width: 100%;
  text-align: center;
  text-decoration: none;
  display: block;
  margin-top: 8px;
}

.alert {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

.alert-error { background: rgba(255,59,48,0.1); color: #FF3B30; }

/* Calendar */
.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.title {
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 700;
  letter-spacing: -0.5px;
}

.user-info {
  font-size: 13px;
  color: rgba(0,0,0,0.5);
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 20px;
  background: rgba(0,122,255,0.1);
  color: #007AFF;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-logout {
  background: rgba(255,59,48,0.1);
  color: #FF3B30;
  margin-left: 8px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  background: rgba(255,255,255,0.9);
  border-radius: 16px;
  padding: 16px 8px;
  text-align: center;
}

.stat-card.accent {
  background: linear-gradient(135deg, #007AFF, #0055D4);
  color: white;
}

.stat-num {
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 700;
}

.stat-label {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.6;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.month-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.nav-btn {
  width: 40px; height: 40px;
  border-radius: 20px;
  background: rgba(255,255,255,0.8);
  border: none;
  cursor: pointer;
  color: #007AFF;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.month-label {
  font-size: 18px;
  font-weight: 700;
}

.calendar {
  background: rgba(255,255,255,0.9);
  border-radius: 20px;
  padding: 16px;
}

.weekdays, .days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.weekday {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: rgba(0,0,0,0.4);
  padding: 8px 0;
  text-transform: uppercase;
}

.day {
  aspect-ratio: 1;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.day:hover:not(.empty):not(.future) {
  transform: scale(1.08);
}

.day.empty { cursor: default; }

.day.today {
  background: rgba(0,122,255,0.1);
  border: 2px solid rgba(0,122,255,0.3);
  color: #007AFF;
}

.day.worked {
  background: linear-gradient(135deg, #34C759, #30B350);
  color: white;
  box-shadow: 0 2px 8px rgba(52,199,89,0.3);
}

.day.future {
  opacity: 0.3;
  cursor: default;
}

.hint {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: rgba(0,0,0,0.4);
}

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(0,122,255,0.2);
  border-top-color: #007AFF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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