/* ================================================================= */
/*                         Allgemeine Stile                          */
/* ================================================================= */
@import url('../css/variables.css');

/* ================================================================= */
/*                               Modal                               */
/* ================================================================= */
@keyframes modalFadeIn {
    0% {
      opacity: 0;
      transform: scale(0.95);
    }
    100% {
      opacity: 1;
      transform: scale(1);
    }
  }
  
  @keyframes modalFadeOut {
    0% {
      opacity: 1;
      transform: scale(1);
    }
    100% {
      opacity: 0;
      transform: scale(0.95);
    }
  }
  
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    background-color: #fff;
    color: #000;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.25s ease-out;

    max-width: 650px;
    width: 85dvw;
    max-height: 700px;
    height: 30dvh;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

.form-body {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-right: 0.5rem;
    /* falls Scrollbar */
}

/* ------------------ Modal Header & Texte ------------------ */
.modal-content h2 {
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

.modal-content p {
    margin-bottom: 2rem;
    font-size: 1rem;
    line-height: 1.5;
}

/* =================== Formular-Struktur =================== */
.modal-content form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Container für alle Formularelemente außer dem Button */
.form-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ------------------ Eingabefelder & Label ------------------ */
.modal-content label {
    display: block;
    margin-bottom: 0.75rem;
}

.modal-content input[type="text"],
.modal-content input[type="email"] {
    width: 100%;
    font-size: 16px;
    padding: 1rem;
    margin-bottom: 0.1rem;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    transition: all 0.2s ease-in-out;
}

.modal-content input[type="text"]:focus,
.modal-content input[type="email"]:focus {
    outline: none;
    border: 1px solid var(--logo-color);

}

.checkbox-wrapper {
    margin-bottom: 1.5rem;
}

/* -------------------- Button -------------------- */
.modal-content button {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.1rem;
    font-weight: bold;
    background-color: #03184b;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.modal-content button:hover {
    background-color: #052062;
}

/* ----------------- Schließen-Button ----------------- */
.modal .close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ==================== Fehleranzeige ==================== */
.error-message {
    display: none;
    color: red;
    font-size: 1rem;
    margin-top: 0.1rem;
}

input.error {
    border: 2px solid #b00000;
    background-color: #ffbaba;
}

/* ================================================================= */
/*                           Responsive Styles                       */
/* ================================================================= */
@media (max-width: 768px) {
    .modal-content {
        width: 90vw;
        height: 80vh;
        padding: 1.5rem;
    }

    .modal-content h2 {
        font-size: 1.5rem;
    }

    .modal-content p {
        font-size: 16px;
    }

    .modal-content input[type="text"],
    .modal-content input[type="email"] {
        font-size: 16px;
        padding: 0.8rem;
    }

    .modal-content button {
        padding: 1rem;
        font-size: 16px;
    }

    .close {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 95vw;
        height: 70vh;
        padding: 1.5rem;
    }

    .modal-content h2 {
        font-size: 1.5rem;
    }

    .modal-content p {
        font-size: 16px;
    }

    .modal-content input[type="text"],
    .modal-content input[type="email"] {
        font-size: 16px;
        padding: 0.7rem;
    }

    .error-message {
        display: none;
        color: red;
        font-size: 0.85rem;
        margin-top: 0.1rem;
        margin-bottom: -0.5rem;
    }    

    .modal-content button {
        padding: 1.2rem;
        font-size: 1rem;
        border-radius: var(--border-radius);
    }

    .close {
        top: 0.25rem;
        right: 0.25rem;
        font-size: 1.5rem;
    }
}