/* SQL Training Platform - Authentication Pages Styles */

/* CSS Variables */
:root {
  /* Primary Colors */
  --color-primary: #428bc0; /*steel blue */
  --color-secondary: #909090; /* Grey Olive */
  --color-thirdary: #87255B; /* Dark Raspberry */
  --color-fourthary: #1D3461; /* Twilight Indigo */
  
  /* Accent Colors (basierend auf Grundfarben) */
  --color-accent: var(--color-fourthary);      /* Twilight Indigo */
  --color-accent-light: #e8eef5;               /* Heller Hintergrund für Infos */

  /* Green Colors */
  --color-green: #4caf50;
  --color-green-light: #8bc34a;
  --color-green-bg: #c8e6c9;
  --color-green-text: #2e7d32;

  /* Red/Error Colors */
  --color-red-bg: #ffcdd2;
  --color-red-text: #c62828;

  /* Grays */
  --color-gray-light: #f5f5f5;
  --color-gray-medium: #e0e0e0;
  --color-gray-dark: #9e9e9e;

  /* Backgrounds */
  --bg-white: #ffffff;
  --bg-light: #f9f9f9;

  /* Gradients */
  --gradient-page: linear-gradient(135deg, var(--color-primary) 0%, var(--color-fourthary) 100%);
  --gradient-green: linear-gradient(135deg, var(--color-green) 0%, var(--color-green-light) 100%);

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 8px 16px rgba(0,0,0,0.2);
  --shadow-lg: 0 12px 24px rgba(0,0,0,0.2);
  --shadow-xl: 0 8px 16px rgba(0,0,0,0.3);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 25px;
}

/* Utility Classes */
.js-hidden {
  display: none !important;
}

/* Common Body Styles for Auth Pages */
body {
  background: var(--gradient-page);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
}

/* Header */
.auth-header {
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 15px 0;
}

.auth-header .container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-header .brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.auth-header .brand img {
  width: 50px;
  height: 50px;
  margin-right: 10px;
}

.auth-header .logo-text {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
}

.auth-header .logo-text-secondary {
  color: var(--color-secondary);
  font-weight: 700;
}

.title {
  color: var(--color-primary);
}

/* Login Page (teacher-login.html) */
body.login-page {
  display: flex;
  flex-direction: column;
}

.login-card {
  max-width: 450px;
  margin: 20px auto;
  border-radius: 8px;
}

.login-card .box,
.join-card .box {
  background: white;
}

/* Main Content Wrapper */
.auth-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px;
  justify-content: center;
  align-items: center;
}

.btn-custom {
  background: var(--color-fourthary);
  color:#ffffff;
  width: 100%;
  transition: filter 0.2s ease;
}

.btn-custom:hover {
  filter: brightness(1.2);
}

/* Terminal/Hacker Style Button */
.btn-terminal {
  background: #0a0a0a;
  color: #ffffff;
  font-family: 'Courier New', Consolas, monospace;
  font-weight: bold;
  letter-spacing: 1px;
  border: 2px solid var(--color-primary);
  border-radius: 0;
  padding: 12px 24px;
  text-transform: none;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.btn-terminal::before {
  content: "> ";
  color: var(--color-primary);
}

.btn-terminal::after {
  content: "_";
  animation: terminal-blink 1s infinite;
  margin-left: 2px;
}

.btn-terminal:hover {
  background: var(--color-primary);
  color: #0a0a0a;
  border-color: var(--color-primary);
}

.btn-terminal:hover::before,
.btn-terminal:hover::after {
  color: #0a0a0a;
}

@keyframes terminal-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.btn-primary-custom {
  background-color: var(--color-fourthary);
  color: white;
  border: none;
  transition: filter 0.2s ease;
}

.btn-primary-custom:hover {
  filter: brightness(1.15);
}
.input:focus,.input:focus-within,.is-focused.input,.is-focused.textarea,.select select.is-focused,.select select:focus,.select select:focus-within,.textarea:focus,.textarea:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.125em rgba(66, 139, 192, 0.25);
}
.control.has-icons-left .input:focus~.icon,.control.has-icons-left .select:focus~.icon,.control.has-icons-right .input:focus~.icon,.control.has-icons-right .select:focus~.icon {
    color:var(--color-thirdary);
}
.teacher-register-text {
  margin-bottom: 15px;
}

.back-link {
  margin-top: 20px;
}

.back-link-text {
  color: var(--color-secondary);
  font-size: 0.9rem;
  text-decoration: none;
}

.back-link-text:hover {
  color: var(--color-primary);
}

.page-title {
  color: var(--color-primary);
}

.primary-link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.primary-link:hover {
  color: var(--color-fourthary);
}

.register-footer-link {
  margin-top: 20px;
}

.register-footer-links {
  margin-top: 30px;
}

/* Form Spacing */
form {
  margin-top: 30px;
}

form hr {
  margin: 30px 0;
}

.form-spacing-bottom {
  margin-bottom: 10px;
}

/* Registration Pages */
body.register-page {
  display: flex;
  flex-direction: column;
}

.register-container {
  background: white;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  max-width: 500px;
  width: 100%;
  margin: 20px;
}

.register-container.large {
  max-width: 700px;
  padding: 30px;
}

/* Info Panel (Schulregistrierung) */
.info-panel {
  background: #f8f9fa;
  border-left: 4px solid var(--color-primary);
  border-radius: 0 4px 4px 0;
  padding: 20px;
  margin-bottom: 25px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.info-panel p {
  margin: 0 0 12px 0;
  color: #444;
}

.info-panel p:last-of-type {
  margin-bottom: 0;
}

.info-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-fourthary);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 15px 0;
}

.info-panel-title .material-icons {
  color: var(--color-primary);
  font-size: 20px;
}

.info-panel-support {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-thirdary);
  font-style: italic;
  margin-top: 15px !important;
}

.info-panel-support .material-icons {
  color: var(--color-thirdary);
}

.info-panel-footer {
  display: flex;
  gap: 20px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.info-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--color-fourthary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.info-link:hover {
  color: var(--color-primary);
}

.info-link .material-icons {
  font-size: 16px;
}

.logo-section {
  text-align: center;
  margin-bottom: 30px;
}

.logo-section h4 {
  background: var(--gradient-page);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: bold;
}

.btn-gradient {
  background: var(--color-fourthary);
  color: white;
  border: none;
  width: 100%;
  transition: filter 0.2s ease;
}

.btn-gradient:hover {
  color: white;
  filter: brightness(1.2);
}

/* Fix for field has-addons alignment */
.field.has-addons .control .button {
  height: 100%;
}

.helper-text {
  font-size: 12px;
  color: var(--color-gray-dark);
}

.info-box {
  background: var(--color-accent-light);
  padding: 15px;
  border-left: 4px solid var(--color-accent);
  border-radius: 4px;
  margin-bottom: 20px;
}

.info-box .material-icons {
  vertical-align: middle;
  margin-right: 5px;
}

/* School Registration Specific */
.step-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
}

.step {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-bottom: 3px solid var(--color-gray-medium);
  color: var(--color-gray-dark);
  transition: all 0.3s;
}

.step.active {
  border-bottom-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: bold;
}

.step.completed {
  border-bottom-color: var(--color-green);
  color: var(--color-green);
}

.url-verify-container {
  margin-bottom: 0.75rem;
}

.url-verify-container .field.has-addons {
  margin-bottom: 0;
}

/* Override width: 100% for btn-gradient inside has-addons */
.field.has-addons .btn-gradient {
  width: auto;
}

.verify-result {
  padding: 10px;
  border-radius: 4px;
  margin-top: 10px;
  display: none;
}

.verify-result.success {
  background: var(--color-green-bg);
  color: var(--color-green-text);
}

.verify-result.error {
  background: var(--color-red-bg);
  color: var(--color-red-text);
}

/* Student Join Page */
.join-card {
  max-width: 500px;
  margin: 20px auto;
  border-radius: 8px;
}

.group-code-input {
  text-transform: uppercase;
  font-family: 'Courier New', monospace;
  font-size: 1.5rem;
  text-align: center;
  letter-spacing: 3px;
}

/* Verify Success Page */
.success-container {
  background: white;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  max-width: 600px;
  width: 100%;
  margin: 20px;
  text-align: center;
}

.checkmark-circle {
  width: 100px;
  height: 100px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--gradient-green);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn 0.5s ease-in-out;
}

.checkmark-circle i {
  font-size: 60px;
  color: white;
}

@keyframes scaleIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.success-container h4 {
  background: var(--gradient-page);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: bold;
}

.info-card {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  text-align: left;
}

.info-card .material-icons {
  vertical-align: middle;
  margin-right: 10px;
  color: var(--color-primary);
}

.info-card li {
  margin: 10px 0;
  display: flex;
  align-items: center;
}

/* Feature Card (Lehrer-Login) */
.feature-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.feature-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-fourthary);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 25px;
}

.feature-card-title .material-icons {
  color: var(--color-primary);
  font-size: 28px;
}

.feature-list-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feature-list-items li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  color: #444;
  font-size: 0.95rem;
  line-height: 1.4;
}

.feature-list-items li:last-child {
  border-bottom: none;
}

.feature-list-items li .material-icons {
  color: var(--color-primary);
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}

.feature-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--color-primary);
  color: var(--color-thirdary);
  font-weight: 600;
  font-size: 0.95rem;
}

.feature-card-footer .material-icons {
  color: var(--color-thirdary);
  font-size: 20px;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
  .feature-card {
    margin-bottom: 20px;
  }
}

/* =====================================================
   Responsive Styles for School Registration
   ===================================================== */

/* Tablet and smaller */
@media (max-width: 900px) {
  .register-container.large {
    max-width: 95%;
    padding: 20px;
    margin: 10px;
  }
}

/* Mobile */
@media (max-width: 600px) {
  /* Smaller container padding */
  .register-container {
    padding: 20px 15px;
    margin: 10px;
    border-radius: 8px;
  }

  .register-container.large {
    padding: 20px 15px;
  }

  /* Step Indicator: Vertical on mobile */
  .step-indicator {
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
  }

  .step {
    padding: 8px 10px;
    border-bottom: none;
    border-left: 3px solid var(--color-gray-medium);
    text-align: left;
    font-size: 0.85rem;
  }

  .step.active {
    border-left-color: var(--color-primary);
    border-bottom: none;
    background: rgba(66, 139, 192, 0.05);
  }

  .step.completed {
    border-left-color: var(--color-green);
    border-bottom: none;
  }

  /* Info Panel */
  .info-panel {
    padding: 15px;
    font-size: 0.85rem;
  }

  .info-panel-title {
    font-size: 0.9rem;
  }

  .info-panel-footer {
    flex-direction: column;
    gap: 10px;
  }

  /* Form fields */
  .field.is-grouped {
    flex-direction: column;
  }

  .field.is-grouped .control {
    margin-bottom: 10px;
    width: 100%;
  }

  .field.is-grouped .control:last-child {
    margin-bottom: 0;
  }

  .field.is-grouped .control .button {
    width: 100%;
  }

  /* URL verify container */
  .url-verify-container .field.has-addons {
    flex-direction: column;
  }

  .url-verify-container .field.has-addons .control {
    width: 100%;
  }

  .url-verify-container .field.has-addons .control .button {
    width: 100%;
    margin-top: 8px;
  }

  /* Summary table */
  .table td {
    display: block;
    padding: 5px 10px;
  }

  .table td:first-child {
    padding-bottom: 0;
    font-size: 0.8rem;
  }

  .table td:last-child {
    padding-top: 2px;
    padding-bottom: 12px;
    word-break: break-word;
  }

  .table tr {
    display: block;
    border-bottom: 1px solid #eee;
  }

  .table tr:last-child {
    border-bottom: none;
  }

  /* Page title */
  .page-title {
    font-size: 1.3rem !important;
  }

  /* Checkbox text */
  .checkbox {
    font-size: 0.85rem;
    line-height: 1.4;
  }

  /* Header */
  .auth-header .brand img {
    width: 40px;
    height: 40px;
  }

  .auth-header .logo-text {
    font-size: 22px;
  }

  /* Auth content padding */
  .auth-content {
    padding: 10px;
  }
}

/* Very small screens */
@media (max-width: 380px) {
  .register-container {
    padding: 15px 12px;
  }

  .step {
    font-size: 0.8rem;
    padding: 6px 8px;
  }

  .info-panel {
    padding: 12px;
    font-size: 0.8rem;
  }

  .info-panel-title {
    font-size: 0.85rem;
  }

  .info-panel-title .material-icons {
    font-size: 18px;
  }

  .button {
    font-size: 0.9rem;
    padding: 8px 12px;
  }

  .label {
    font-size: 0.85rem;
  }

  .help {
    font-size: 0.75rem;
  }
}

/* ========================================
   Verify Page States
   ======================================== */

.state-icon-large {
  font-size: 48px;
}

.state-title {
  margin-top: 15px;
}

.state-message {
  margin-bottom: 25px;
}

/* ========================================
   Form Step Content Spacing
   ======================================== */

.step-content-mt-30 {
  margin-top: 30px;
}

.step-content-mt-20 {
  margin-top: 20px;
}

.info-panel-section-title {
  margin-top: 20px;
}

.freemail-warning {
  margin-top: 5px;
}

/* ========================================
   Verify Success Page
   ======================================== */

.success-info-card {
  margin: 30px auto;
  max-width: 500px;
}

.success-steps-list {
  list-style: none;
  padding: 0;
  text-align: left;
}

.success-steps-list li {
  margin: 10px 0;
}

.success-notification {
  text-align: left;
  max-width: 500px;
  margin: 0 auto;
}

.success-login-btn {
  margin-top: 20px;
}

.success-footer-text {
  margin-top: 20px;
  font-size: 12px;
}

/* ========================================
   Hero Section (Landing Page)
   ======================================== */

.hero-section {
  margin-bottom: 30px;
}

.hero-title-white {
  color: white;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.hero-subtitle-white {
  color: rgba(255,255,255,0.9);
}

/* ========================================
   Registration Form Elements
   ======================================== */

.form-error-message {
  margin-top: 20px;
}

/* ========================================
   Legal Pages (Impressum, Datenschutz)
   ======================================== */

.legal-content {
  background: white;
  border-radius: 8px;
  padding: 40px;
  max-width: 700px;
  margin: 0 auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.legal-content h1 {
  color: var(--color-fourthary);
  font-size: 2rem;
  margin-bottom: 30px;
}

.legal-content h2 {
  color: var(--color-fourthary);
  font-size: 1.2rem;
  margin-top: 30px;
  margin-bottom: 15px;
}

.legal-content p {
  color: #444;
  line-height: 1.7;
  margin-bottom: 12px;
}

.legal-content .company-box {
  background: #f8f9fa;
  border-left: 4px solid var(--color-primary);
  padding: 25px;
  margin: 20px 0;
  border-radius: 0 4px 4px 0;
}

.legal-content .company-box h2 {
  color: var(--color-fourthary);
  font-size: 1.3rem;
  margin: 0 0 15px 0;
}

.legal-content .company-box p {
  margin: 8px 0;
}

.legal-content a {
  color: var(--color-primary);
}

.legal-content a:hover {
  color: var(--color-fourthary);
}

.legal-content .info-section {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

/* Datenschutz page specific (wider layout) */
.legal-content.legal-content-wide {
  max-width: 900px;
}

.legal-content.legal-content-wide h1 {
  margin-bottom: 10px;
}

.legal-content.legal-content-wide h2 {
  font-size: 1.4rem;
  margin-top: 35px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-primary);
}

.legal-content h3 {
  color: var(--color-fourthary);
  font-size: 1.1rem;
  margin-top: 25px;
  margin-bottom: 10px;
}

.legal-content li {
  color: #444;
  line-height: 1.7;
  margin-bottom: 12px;
}

.legal-content ul {
  margin-left: 20px;
  margin-bottom: 15px;
}

.legal-content .last-updated {
  color: var(--color-secondary);
  font-size: 0.9rem;
  margin-bottom: 30px;
}

.legal-content .contact-box {
  background: #f8f9fa;
  border-left: 4px solid var(--color-primary);
  padding: 20px;
  margin: 20px 0;
  border-radius: 0 4px 4px 0;
}

.legal-content .contact-box p {
  margin: 5px 0;
}

.back-link-container {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

/* ========================================
   Animations
   ======================================== */

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

.rotating {
  animation: rotate 1s linear infinite;
}

/* ========================================
   Preview Template Cards (Landing Page)
   ======================================== */

.preview-template-card {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 12px;
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.preview-template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

.preview-template-content {
  flex: 1;
}

.preview-template-description {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
  max-height: 4.5em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.preview-start-btn {
  margin-top: auto;
}

/* Responsive preview section */
@media (max-width: 768px) {
  #previewSection .columns {
    padding: 0 10px;
  }

  .preview-template-card {
    padding: 15px;
  }
}
