/* Premium Login/Register Styling for Schulplaner */

:root {
  --primary: #5FBFA9; /* mint-dark */
  --primary-light: #C6FFF4; /* mint */
  --accent: #FFA8A8; /* coral */
  --accent-dark: #E06B6B; /* coral-dark */
  --bg-color: #FAF7F0; /* paper */
  --bg-grid: #ECE6D8; /* paper-line */
  --text-main: #22303B; /* ink */
  --text-muted: #5B6B74; /* ink-soft */
  --card-bg: #FFFFFF;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: 
    radial-gradient(circle at 10% 20%, rgba(95, 191, 169, 0.1) 0%, rgba(255, 168, 168, 0.1) 90%),
    linear-gradient(var(--bg-grid) 1px, transparent 1px) 0 0 / 100% 28px,
    var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* Notebook Container */
.login-container {
  width: 100%;
  max-width: 440px;
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Schulplaner Brand Header */
.brand-header {
  text-align: center;
  margin-bottom: 28px;
}

.brand-header h1 {
  font-family: 'Fraunces', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  position: relative;
  display: inline-block;
}

/* Underline decoration */
.brand-header h1::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 10%;
  width: 80%;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  transform: skewX(-15deg);
}

.brand-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Notebook Login Card */
.notebook-card {
  position: relative;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 
    0 10px 30px -5px rgba(34, 48, 59, 0.15),
    0 0 1px 1px rgba(34, 48, 59, 0.05);
  padding: 40px 32px 32px 48px; /* Left padding is larger for the binder rings */
  width: 100%;
  border-left: 20px solid var(--accent);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.notebook-card:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 15px 35px -5px rgba(34, 48, 59, 0.18),
    0 0 1px 1px rgba(34, 48, 59, 0.05);
}

/* Ring binder holes simulation */
.notebook-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -20px;
  width: 20px;
  height: 100%;
  background-image: radial-gradient(circle, var(--bg-grid) 5px, transparent 6px);
  background-size: 20px 32px;
  background-position: center 16px;
}

/* Cute Binder Rings SVG simulation overlay */
.notebook-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: -12px;
  width: 18px;
  height: 100%;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 10px,
    #D0C6B2 10px,
    #E8DFCE 12px,
    #A89E8A 14px,
    transparent 14px,
    transparent 32px
  );
  opacity: 0.75;
  pointer-events: none;
}

.notebook-card h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  margin-bottom: 24px;
  color: var(--text-main);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Forms */
.form-group {
  position: relative;
  margin-bottom: 24px;
}

.form-input {
  width: 100%;
  padding: 14px 12px 6px 0px;
  border: none;
  border-bottom: 2px solid var(--bg-grid);
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease;
}

/* Label styling with floating animation */
.form-label {
  position: absolute;
  left: 0;
  top: 12px;
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.2s ease;
  font-weight: 500;
}

/* Floating logic */
.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label,
.form-input:-webkit-autofill ~ .form-label,
.form-input:autofill ~ .form-label {
  top: -8px;
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input:focus {
  border-color: var(--primary);
}

/* Prevent default webkit autofill background coloring and match card aesthetic */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover, 
.form-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-main) !important;
  transition: background-color 5000s ease-in-out 0s;
  caret-color: var(--text-main);
}

/* Custom Password Toggle Container */
.password-container {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 0;
  top: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  transition: color 0.2s ease;
}

.password-toggle:hover {
  color: var(--text-main);
}

/* Custom Checkbox */
.remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.checkbox-container input {
  display: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--bg-grid);
  border-radius: 4px;
  display: inline-block;
  position: relative;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.checkbox-container input:checked ~ .checkbox-custom {
  background-color: var(--primary);
  border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkbox-custom::after {
  content: "✓";
  color: #0E332B;
  position: absolute;
  font-size: 11px;
  font-weight: 800;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Submit Button */
.submit-btn {
  width: 100%;
  padding: 14px;
  background-color: var(--primary);
  color: #0E332B;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(95, 191, 169, 0.2);
}

.submit-btn:hover {
  background-color: #52a894;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(95, 191, 169, 0.3);
}

.submit-btn:active {
  transform: translateY(1px);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Footer / Switch link */
.card-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.card-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s ease;
}

.card-footer a:hover {
  color: #438f7d;
  text-decoration: underline;
}

/* Alert Notification Panel */
.alert-box {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 20px;
  display: none;
  font-weight: 600;
  animation: slideDown 0.3s ease;
}

.alert-box.error {
  display: block;
  background-color: #FFE1E1;
  color: #8A2E2E;
  border: 1px solid rgba(138, 46, 46, 0.15);
}

.alert-box.success {
  display: block;
  background-color: var(--primary-light);
  color: #0E332B;
  border: 1px solid rgba(95, 191, 169, 0.2);
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(14, 51, 43, 0.2);
  border-top-color: #0E332B;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.loading .spinner {
  display: inline-block;
}
.loading .btn-text {
  display: none;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Site footer (matches mainpage footer style) */
.site-footer {
  width: 100%;
  max-width: 440px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 2px dashed #DDD5C4;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}

.site-footer .foot-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
}

.site-footer .foot-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.site-footer .foot-meta .stamp {
  font-weight: 600;
  background: #F5F1E6;
  padding: 2px 8px;
  border-radius: 20px;
}

.site-footer .foot-meta .heart {
  color: var(--accent-dark);
}

.site-footer .foot-meta a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.site-footer .foot-meta a:hover {
  text-decoration: underline;
}

.shake-animation {
  animation: shake 0.35s ease-in-out;
}
