dialog {
    /* Fastlåser positionen i midten af skærmen */
    margin: 0 auto; 
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

   /* Basis styling */
    border: none;
    border-radius: 8px;
    padding: .25rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    
    /* Sørger for den ikke bliver for bred på mobiler */
    width: max(800px, 320px);
    height: max(640px, 480px);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden; /* Skjuler overflow for at undgå scrollbars */
} 

/* Styling af den mørke baggrund */
dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

/* Custom backdrop for non-dialog elements */
.dialog-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
  display: block;
}

/* Grid-containeren der skaber de to kolonner */
.dialog-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* To lige store kolonner */
    height: 100%;
    width: 100%;
    border: 1px solid var(--bs-gray-600);
}

/* Venstre kolonne: Billedet */
.login-img img {
    width: 100%;
    height: 100%;
    /* Sikrer at billedet fylder hele kolonnen uden at blive strakt */
    object-fit: cover; 
    display: block;
    /* border-top-left-radius: 7px;
    border-bottom-left-radius: 7px; */
}

/* Højre kolonne: Formularen */
.login-content {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: normal;
    /* align-items: stretch; */
    background-color: var(--bs-dark);
    /* border-top-right-radius: 7px;
    border-bottom-right-radius: 7px; */
    border-left: 1px solid var(--bs-gray-600);
    transition: color 0.2s ease-in-out;
    overflow-y: auto;
    overflow-x: hidden;
}
/* for login form */
.login-title-container {
    margin-bottom: 1rem;
    text-align: center;
    /* background-color: red; */
    padding: 0.5rem 0;
    p {
        color: var(--bs-gray-400);
        font-size: .9em;
        margin: 0;
   }
}

.login-content h3 {
    margin-top: 0;
    margin-bottom: .5rem;
     color: var(--light-gray-100);
}

.profile-field label,
.field-group label {
    color: var(--bs-light);
    font-weight: normal;
    margin-top: 1rem;
    margin-bottom: .5rem;
    display: block;
}

/* Styling af inputs (genbrug fra før) */
.profile-field input[type="text"],
.profile-field input[type="email"],
.login-content input[type="text"],
.login-content input[type="password"] {
    font-size: 1rem;
    width: 100%;
    padding: .5rem;
    margin-bottom: .5rem;
    border: 0;
    outline: none;
    /* border-radius: 6px;
    box-sizing: border-box; */
    background: var(--bs-light);
    color: var(--bs-dark)
} 
.login-content input[type="password"] {
    margin-bottom: .5rem;
}

.login-content input[type="text"]:focus,
.login-content input[type="password"]:focus {
    /* border: 0px solid var(--bs-primary); */
    background: var(--bs-gray-400);
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}
.password-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
    margin-bottom: 1.25rem;
}

.show-password,
.clear-fields {
    font-size: 0.85rem;
    color: var(--bs-light);
    cursor: pointer;
    -webkit-user-select: none; /* Safari/iOS */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE10+/Edge */
    user-select: none; /* Standard */
}

.clear-fields {
    color: var(--bs-gray-400);
    transition: color 0.2s ease;
}

.clear-fields:hover {
    color: var(--bs-light);
}

/* Grundlæggende styling af beholderen */
.checkbox-group {
    display: flex;
    justify-items: center;
    justify-content: left;
    width: auto;
    height: auto!important;
    color: var(--bs-light);
    /* cursor: pointer; */
}

.checkbox-group input[type="checkbox"] {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #007bff; /* Skifter farven på selve tjekboksen */
}

.description-wrap {
    position: absolute;
    top: 1rem;
    left: 2rem;
    width: max(43%, 320px);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    background-color: transparent;
    padding: 2px 6px;
    border-radius: 4px;
    /*background-color: red;  midlertidig baggrundsfarve for at se placeringen */

    > .title {
        font-weight: bold;
        font-size: 1.5rem;
        margin-bottom: .25rem;
    }
    > .sub-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        font-weight: 500;
    }
    > p {
        font-size: 0.75rem;
        line-height: 1.25rem;
        font-weight: 300;
    }

}

.description-bottom-wrap {
    position: absolute;
    bottom: 1rem;
    left: 2rem;
    width: max(43%, 320px);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    background-color: transparent;
    padding: 2px 6px;
    border-radius: 4px;

    > .sub-title {
        font-size: 1rem;
        font-weight: 300;
    }
    > a {
        font-size: 0.75rem;
        font-weight: 300;
        color: var(--bs-light);
        text-decoration: none;
    }
    > a:hover {
        text-decoration: underline; 
    }

}
/* Styling af "Ikke medlem" sektionen */
.not-member {
    padding-top: 1rem;
}
.forget-password,
.not-member {
    width: 100%;
    color: var(--bs-light);
    margin: .5rem 0 .5rem 0;
}
.forget-password {
    margin-top: 0;
    margin-bottom: 1rem;
}

.forget-password a,
.not-member a {
    color: var(--bs-light);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.forget-password a:hover,
.not-member a:hover {
    text-decoration: underline;
}

/* Knapperne */
.button-group {
    display: flex;
    gap: 5px;
    margin-top: 1.5rem;
}

/* Knap styling */
button {
    padding: 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border-600);
    cursor: pointer;
    font-weight: normal;
    font-size: 1em;
}

.btn-primary {
    background-color: var(--primary-green);
    color: var(--bs-light);
    flex: 1;
}

.btn-secondary {
    background-color: var(--primary-green-low);
    color: #ccc;
    flex: 1;
}

/* ============================================
   LOG OUT DIALOG STYLING
   ============================================ */

/* Fjernet første definition - se den komplette linje 438 */


/* ============================================
   ERROR DIALOG STYLING
   ============================================ */
.success-dialog,
.error-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    /* display: block; */
    width: 480px!important;
    max-width: 90vw;
    height: auto !important;
    max-height: auto;
    padding: 1rem !important;
    
    box-sizing: border-box;
    border: 1px solid #aaa;
    border-radius: .75rem;
    background-color: var(--bs-light);
    z-index: 10000;
}
.success-dialog.hidden,
.error-dialog.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.error-description {
    padding: 1rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: left !important;
    color: var(--bs-dark);
}
.success-dialog-container,
.error-dialog-container {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.error-description > h5 { text-align: center; margin-bottom: 1rem;}

.error-description { 
    font-weight: 500; 
    color: var(--bs-dark);
    line-height: 1.4;
}
.success-dialog-container button,
.error-dialog-container button {
    padding: 0.75em 3.5em;
    font-weight: 500;
    border: none;
    border-radius: 0.5em;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--primary-green);
    color: white;
    /* iOS specific fixes */
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}


/* Responsivt design: stable dem ovenpå hinanden på små skærme */
@media (max-width: 400px) {
    .info-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Mobile styling for error-dialog */
@media (max-width: 768px) {
    .success-dialog,
    .error-dialog {
        width: 95vw !important;
        padding: 0.5rem !important;
    }
    .success-dialog-container,
    .error-dialog-container {
        padding: 0.5rem;
    }
    .success-dialog-description,
    .error-description {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    .success-dialog-description > h5,
    .error-description > h5 { 
        width: 100%;
        color: var(--bs-danger) !important;
        -webkit-text-fill-color: var(--bs-danger) !important;
        padding: .5rem !important;
        font-size: 1rem !important;
        margin-bottom: 0.75rem !important;
    }
    .success-dialog-description p,
    .error-description p {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 0.75rem;
    }
    .success-icon svg,
    .error-icon svg {
        height: 40px !important;
        width: 48px !important;
    }
    .success-dialog-container button,
    .error-dialog-container button {
        padding: 0.75em 2em;
        width: 100%;
        max-width: 200px;
    }
}


/* ============================================
   LOGOUT DIALOG STYLING
   ============================================ */
.logout-dialog {
    position: fixed;
    top: 50%;
    left: 50%;   
    transform: translate(-50%, -50%);
    
    width: 460px;
    max-width: 100%;
    min-height: fit-content;
    max-height: 320px;
    
    border: none;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 10000;
    margin: 0;
}

.logout-dialog-container {
    
    padding: 5rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.logout-icon {
    width: 45px;
    height: 45px;
    background-color: #ffebee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-dialog-container h3 {
    margin: 0;
    font-size: 1.1em;
    color: var(--bs-dark);
}

.logout-dialog-container p {
    margin: 0;
    font-size: 0.9em;
    color: var(--bs-gray-600);
}

.logout-button-group {
    position: absolute;
    bottom: 0rem !important;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem;

    display: flex;
    gap: 1rem;
    width: 100%;
    /* margin-top: 0;
    padding-top: 5rem; */
}

.logout-button-group button {
    flex: 1;
    padding: 1em;
    font-size: 0.9em;
    font-weight: 500;
    border: none;
    border-radius: 0.5em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger {
    background-color: #d32f2f;
    color: white;
}

.btn-danger:hover {
    background-color: #b71c1c;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
}

.btn-secondary {
    background-color: var(--bs-gray-500);
    color: var(--bs-dark);
}

.btn-secondary:hover {
    background-color: var(--bs-gray-300);
}

.loginDialog {
    width: 800px;
    border-radius: 0px;
    padding: 0rem !important;
    margin: 0 !important;
}

/* Mobil responsivitet */
@media (max-width: 480px) {
    /* Tilpas login dialog til mobil */
    .loginDialog {
        grid-template-columns: 1fr !important;
        width: 100vw !important;
        border-radius: 0px;
        padding: 0rem !important;
        margin: 0 !important;
        
    }
    .dialog-container {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important; 
    }

    .login-img {
        display: none; /* Skjul billede på mobil */
    }

    .login-content {
        border-radius: 7px; /* Rund alle hjørner når der kun er én kolonne */
        border-left: none;
    }

    /* Logout dialog mobil */
    .logout-button-group {
        flex-direction: column;
    }
    
    .logout-dialog-container {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .loginDialog {
        grid-template-columns: 1fr !important;
        width: 100vw !important;
        border-radius: 0px;
        padding: 0rem !important;
        margin: 0 !important;
        
    }
    .dialog-container {
        grid-template-columns: 1fr !important; /* Kun én kolonne på mobil */
        /* width: 100vw !important;*/
        margin: 0 !important;
        padding: 0 !important; 
    }
    .loginDialog .login-content {
        border-radius: 0px; /* Fjern runding på hjørnerne */
        border-left: none;
        padding: 1rem .75rem!important;
        /* background-color: tomato; */
    }

    .error-description > h5 { 
        width: 100% !important;
        color: var(--bs-danger) !important;
        -webkit-text-fill-color: var(--bs-danger) !important;
        padding: .5rem !important;
        font-size: 1.75rem !important;
        margin-bottom: 0.75rem !important;
    }

    .login-title-container {
        margin-bottom: 1.5rem;
        text-align: center;
    }
    .login-title-container > h3 {
        font-size: 1.75rem !important;
        font-weight: 600 !important;
        color: var(--bs-light) !important;
        -webkit-text-fill-color: var(--bs-light) !important;
    }
    .login-title-container > p {
        color: var(--bs-light) !important;
        -webkit-text-fill-color: var(--bs-light) !important;
        font-size: .9em;
        margin: 0;
    }
    .forget-password,
    .not-member {
    width: 100% !important;
    color: var(--bs-light);
    margin: .5rem 0 .5rem 0;
    font-size: .875rem !important;
}


}

/* ============================================
   REGISTER DIALOG STYLING
   ============================================ */
.register-dialog {
    width: 1024px !important;
    height: 800px !important;
    max-width: 95vw;
    max-height: 95vh;
}

.register-dialog-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
    width: 100%;
    overflow-y: auto;
}

.register-img {
    position: relative;
    background-color: var(--primary-green);
    border-top-left-radius: 7px;
    border-bottom-left-radius: 7px;
    overflow: hidden;
}

.register-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.7;
}

.register-img .description-wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 10;
    padding: 2rem;
}

.register-img .title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    width: 100%;
    white-space: normal;
    line-height: 1.2;
}

.register-img .sub-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.register-img .description-wrap p {
    font-size: 0.95rem;
    line-height: 1.5;
}

.register-content {
    padding: 1.5rem;
    display: grid;
    grid-template-rows: auto 1fr;
    background-color: var(--bs-dark);
    background-color: var(--bs-gray-700);
    border-top-right-radius: 7px;
    border-bottom-right-radius: 7px;
    overflow: hidden;
    color: var(--bs-dark);
    height: 100%;
    gap: 0.5rem;
    position: relative; /* For absolut positionering af X knap */
}

/* X lukke-knap øverst til højre */
.register-content .close-dialog-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--bs-gray-400);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 10;
}

.register-content .close-dialog-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--bs-light);
}

.register-content .close-dialog-btn svg {
    width: 24px;
    height: 24px;
}

.register-content form {
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100%;
    gap: 0;
}

.register-title-container {
    text-align: center;
    flex-shrink: 0;
}

.register-title-container h3 {
    margin: 0 0 0.5rem 0;
    color: var(--light-gray-100);
    font-size: 1.5rem;
}

.register-title-container p {
    color: var(--bs-gray-400);
    font-size: 0.9rem;
    margin: 0;
}

.register-title-container .required-note {
    color: var(--bs-danger);
    font-size: 01rem;
    margin-top: 0.75rem;
    font-style: italic;
} 

.registerForm {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1rem;
}

.form-scroll-container {
    overflow-y: scroll;
    overflow-x: hidden;
    padding-right: 0.75rem;
    max-height: 680px;
}


.form-scroll-container::-webkit-scrollbar {
    width: 16px;
}

.form-scroll-container::-webkit-scrollbar-track {
    background: var(--bs-gray-700);
    border-radius: 3px;
}

.form-scroll-container::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 3px;
}

.form-scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-green);
}

.section-divider {
    margin: 1.5rem 0 1rem 0;
    border: none;
    border-top: 1px solid var(--bs-gray-600);
}

.section-title {
    color: var(--bs-gray-400);
    font-size: 0.9rem;
    font-weight: 500;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.register-content .field-group {
    margin-bottom: 1rem;
}

/* Label med action (vis adgangskoden) på samme linje */
.register-content .label-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.register-content .label-with-action label {
    margin-bottom: 0;
}

.register-content .show-password-reg {
    font-size: 0.85rem;
    color: var(--bs-light);
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    white-space: nowrap;
}

.register-content .show-password-reg:hover {
    color: var(--bs-gray-300);
}

.register-content .field-group label {
    color: var(--bs-light);
    font-weight: normal;
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.95rem;
}

.register-content .field-group label .required {
    color: #ff6b6b;
    color: #fff;
    /* font-weight: 600; */
    font-weight: bold;
}

.register-content input[type="text"],
.register-content input[type="email"],
.register-content input[type="password"],
.register-content input[type="tel"],
.register-content input[type="date"],
.register-content select,
.register-content textarea {
    font-size: 0.95rem;
    width: 100%;
    padding: 0.6rem;
    border: 0;
    outline: none;
    border-radius: 4px;
    background: var(--bs-light);
    color: var(--bs-dark);
    box-sizing: border-box;
}

.register-content textarea {
    resize: vertical;
    font-family: inherit;
}

.register-content select {
    cursor: pointer;
}
.button-divider {
    margin: 1.5rem 0 1rem 0;
    border: none;
    border-top: 1px solid var(--bs-gray-600);
}

.register-content .button-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.register-content .btn-primary,
.register-content .btn-secondary {
    flex: 1;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
}

.register-content .btn-primary {
    background-color: var(--primary-green);
    color: var(--bs-light);
    border: 1px solid var(--bs-gray-600);
}

.register-content .btn-primary:hover {
    background-color: var(--bs-gray-800);
}

.register-content .btn-secondary {
    background-color: var(--bs-gray-700);
    color: var(--bs-light);
    border: 1px solid var(--bs-gray-600);
}

.register-content .btn-secondary:hover {
    background-color: var(--bs-gray-600);
}

@media (max-width: 767px) {
    .register-dialog {
        width: 100vw !important;
        height: fit-content !important;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        padding: 0 !important;
    }

    .register-dialog-container {
        grid-template-columns: 1fr !important;
        height: 100%;
    }

    .register-img {
        display: none;
    }

    .register-content {
        border-radius: 0;
        height: fit-content !important;
        height: 100dvh; /* Dynamic viewport height for iOS */
        padding: 1rem;
        display: flex;
        flex-direction: column;
        position: relative;
    }

    .register-content form {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .register-title-container {
        flex-shrink: 0;
    }

    .form-scroll-container {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        padding-right: 0.5rem;
        padding-bottom: 80px;
    }

    .register-content input[type="text"],
    .register-content input[type="email"],
    .register-content input[type="password"],
    .register-content input[type="tel"],
    .register-content input[type="date"],
    .register-content select,
    .register-content textarea {
        min-height: 44px;
        height: 44px;
        padding: 0.75rem 0.6rem;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }

    .register-content textarea {
        height: auto;
        min-height: 88px;
    }

    .register-content input[type="date"],
    .register-content select {
        line-height: normal;
        box-sizing: border-box;
    }

    .register-content .button-group {
        margin-bottom: 2rem;
    }

    .field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
