/* Responsive styles for BK Registration App */

/* Animation for success checkmark */
@keyframes scaleAnimation {
  0% { opacity: 0; transform: scale(1.5); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes drawCheck {
  0% { stroke-dashoffset: 100; }
  100% { stroke-dashoffset: 0; }
}

.success-animation {
  margin: 20px auto;
}

.checkmark-circle {
  width: 150px;
  height: 150px;
  position: relative;
  display: inline-block;
  vertical-align: top;
}

.checkmark-circle .background {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: #71BBB2;
  position: absolute;
}

.checkmark-circle .checkmark {
  border-radius: 5px;
}

.checkmark-circle .checkmark.draw:after {
  animation-delay: 100ms;
  animation-duration: 1s;
  animation-timing-function: ease;
  animation-name: drawCheck;
  transform: scaleX(-1) rotate(135deg);
  animation-fill-mode: forwards;
  stroke: #71BBB2;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  content: '';
  position: absolute;
  width: 60px;
  height: 120px;
  top: 10px;
  left: 45px;
  border-right: 15px solid #27445D;
  border-top: 15px solid #27445D;
}

/* Card hover effects */
.category-container {
  transition: all 0.3s ease;
}

.category-container:hover {
  transform: translateY(-5px);
  box-shadow: #0a3d62 10px 10px 15px;
}

/* Form input focus effects */
.form-element > input:focus {
  box-shadow: 0 0 8px rgba(52, 152, 219, 0.8);
  transition: box-shadow 0.3s ease;
}

/* Link styling */
.infotext a {
  color: #3498db;
  text-decoration: none;
  border-bottom: 1px solid;
  padding-bottom: 2px;
  transition: color 0.3s ease;
}

.infotext a:hover {
  color: #2980b9;
}

/* Base responsive settings */
html {
  font-size: 16px;
}

body {
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

main {
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  padding: 15px 0;
  width: 100%;
}

.form-container, .infotext-container, .summary-container {
  width: 95%;
  max-width: 95%;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
}

/* Prevent horizontal overflow */
header {
  width: 100%;
  box-sizing: border-box;
  padding: 15px 0;
}

/* Media queries for responsive design */
/* Modern form styling */
.form-element {
  transition: all 0.3s ease;
}

.form-element > input {
  transition: all 0.3s ease;
}

.form-element:focus-within {
  border-color: #3498db;
  box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.submit-button {
  transition: all 0.3s ease;
  cursor: pointer;
}

.submit-button:hover:not(:disabled) {
  background-color: #2980b9;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(10, 61, 98, 0.3);
}

/* Radio and checkbox styling */
.check-element .checkbox,
.check-element .radio {
  cursor: pointer;
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  background-color: #fff;
  border: 2px solid #60a3bc;
  border-radius: 4px;
  margin-right: 12px;
  transition: all 0.3s ease;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  display: inline-block;
  vertical-align: middle;
}

.check-element .radio {
  border-radius: 50%;
}

.check-element .checkbox:checked,
.check-element .radio:checked {
  background-color: #60a3bc;
}

.check-element .checkbox:checked::after {
  content: '✓';
  font-size: 1.2rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
}

.check-element .radio:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40%;
  height: 40%;
  background-color: white;
  border-radius: 50%;
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  body {
    overflow-x: hidden !important;
  }
  
  main {
    width: 100% !important;
    padding: 10px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  
  .logo {
    width: 90% !important;
  }
  
  .form-container {
    width: 95% !important;
    max-width: 95% !important;
    padding: 8px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }
  
  .category-container {
    width: 100% !important;
    margin: 15px auto !important;
    box-sizing: border-box !important;
  }
  
  .infotext-container, .summary-container {
    width: 95% !important;
    max-width: 95% !important;
    margin: 15px auto !important;
    box-sizing: border-box !important;
  }
  
  .form-element > input {
    font-size: 1rem !important;
    padding: 12px !important;
  }
  
  .form-element {
    margin: 10px 0 5px 0 !important;
  }
  
  .category-container .form-element {
    margin: 10px 0 5px 0 !important;
  }
  
  .category-container .form-element:first-of-type {
    margin-top: 10px !important;
  }
  
  .category-container .two-form-elements {
    margin: 10px 0 5px 0 !important;
  }
  
  .check-element {
    margin: 3px 0 3px 0 !important;
    padding: 6px !important;
  }
  
  input[type="date"] {
    font-size: 1rem !important;
    height: 48px !important;
  }
  
  .form-element > label {
    font-size: 1rem !important;
  }
  
  .check-element {
    font-size: 1rem !important;
  }
  
  .check-element .checkbox,
  .check-element .radio {
    height: 1.5rem !important;
    width: 1.5rem !important;
    margin-right: 15px !important;
  }
  
  .b-letter-container .checkbox {
    height: 1.3rem !important;
    width: 1.3rem !important;
    min-width: 1.3rem !important;
    min-height: 1.3rem !important;
    margin-right: 10px !important;
  }
  
  .b-letter-container label {
    font-size: 1rem !important;
  }
  
  .category {
    font-size: 1.5rem !important;
  }
  
  .infotext-heading, .summary-heading {
    font-size: 1.5rem !important;
  }
  
  .heading-1 {
    font-size: 2rem !important;
  }
  
  .heading-2 {
    font-size: 1.2rem !important;
  }
  
  .infotext {
    font-size: 1.2rem !important;
  }
  
  .info-text {
    font-size: 1rem !important;
  }
  
  .submit-button {
    font-size: 1.5rem !important;
    padding: 15px !important;
  }
  
  .category-container > fieldset {
    font-size: 1rem !important;
  }
  
  .two-form-elements {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px; /* Slightly smaller gap on mobile */
  }
  
  .two-form-elements .form-element {
    width: auto !important;
  }
  
  #street-element, #street-element-contact {
    width: calc(74% - 4px) !important;
    flex-grow: 3;
  }
  
  #housenumber-element, #housenumber-element-contact {
    width: calc(24% - 4px) !important;
    flex-grow: 1;
  }
  
  #postal-element, #postal-element-contact {
    width: calc(30% - 4px) !important;
    flex-grow: 1;
  }
  
  #city-element, #city-element-contact {
    width: calc(68% - 4px) !important;
    flex-grow: 3;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  html {
    font-size: 15px;
  }
  
  .logo {
    width: 70% !important;
  }
  
  .form-element > input {
    font-size: 1.5rem !important;
  }
  
  .submit-button {
    font-size: 2rem !important;
    padding: 25px !important;
  }
}

@media (min-width: 1025px) {
  html {
    font-size: 16px;
  }
  
  body {
    max-width: 100%;
    margin: 0 auto;
    overflow-x: hidden;
  }
  
  .form-container {
    width: 95%;
    max-width: 800px;
    margin: 0 auto;
  }
  
  .infotext-container, .summary-container {
    width: 95%;
    max-width: 800px;
    margin: 0 auto 20px auto;
  }
  
  .logo {
    max-width: 400px;
  }
  
  header {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    left: 0;
    right: 0;
  }
  
  main {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  
  .progress-indicator {
    max-width: 600px;
    margin: 20px auto;
  }
}

/* Progress indicator styling */
.progress-indicator {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  width: 90%;
  max-width: 800px;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 0 0 auto;
}

.progress-step .step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #edf2f4;
  color: #27445D;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  border: 2px solid #27445D;
  margin-bottom: 5px;
  transition: all 0.3s ease;
}

.progress-step .step-text {
  color: #27445D;
  font-size: 0.8rem;
  font-weight: bold;
  text-align: center;
}

.progress-step.active .step-number {
  background-color: #27445D;
  color: #edf2f4;
  transform: scale(1.1);
}

.progress-step.completed .step-number {
  background-color: #71BBB2;
  color: #edf2f4;
  border-color: #71BBB2;
}

.progress-step.completed .step-number::after {
  content: '✓';
  position: absolute;
}

.progress-line {
  height: 3px;
  background-color: #27445D;
  flex: 1;
  margin: 0 15px;
  position: relative;
  top: -20px;
}

@media (max-width: 768px) {
  .progress-indicator {
    width: 100%;
  }
  
  .progress-step .step-number {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }
  
  .progress-step .step-text {
    font-size: 0.7rem;
  }
  
  .progress-line {
    margin: 0 10px;
  }
}

/* Additional improvements */
.form-element > input:focus {
  outline: none;
  box-shadow: 0 0 5px #3498db;
}

.submit-button {
  transition: all 0.2s ease;
}

.category-container {
  transition: all 0.3s ease;
}

.category-container:hover {
  box-shadow: #0a3d62 8px 8px 15px;
}

/* Accessibility improvements */
input:focus, button:focus {
  outline: 2px solid #3498db;
}

/* Animation for form feedback */
@keyframes highlightField {
  0% { border-color: #e74c3c; }
  50% { border-color: #e74c3c; box-shadow: 0 0 5px #e74c3c; }
  100% { border-color: #60a3bc; }
}

.highlight-error {
  animation: highlightField 1.5s ease;
}

/* Fade-in animation for content */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.category-container, .infotext-container, .summary-container {
  animation: fadeIn 0.6s ease-out;
}

/* Stagger animations for multiple containers */
.category-container:nth-child(1) { animation-delay: 0.1s; }
.category-container:nth-child(2) { animation-delay: 0.2s; }
.category-container:nth-child(3) { animation-delay: 0.3s; }
.category-container:nth-child(4) { animation-delay: 0.4s; }

/* Subtle hover effect for checkboxes and radio buttons */
.check-element:hover {
  background-color: rgba(113, 187, 178, 0.1);
  border-radius: 8px;
  transition: background-color 0.3s ease;
}

/* Enhanced form interactions */
.form-element.focused {
  border-color: #3498db;
  box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.form-element.invalid {
  border-color: #e74c3c;
  box-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
}

.form-element.invalid input {
  background-color: rgba(231, 76, 60, 0.05);
}

.form-element.has-content label {
  color: #27445D;
  font-weight: bold;
}

/* Shake animation for invalid fields */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.form-element.shake {
  animation: shake 0.5s ease;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #27445D;
  color: white;
  font-size: 24px;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.back-to-top.visible {
  opacity: 0.8;
  visibility: visible;
}

.back-to-top:hover {
  opacity: 1;
  transform: translateY(-3px);
}
