/* ===== CSS Variables (from original Kleinanzeigen theme) ===== */
:root {
    --primary-color: #B5E941;
    --button-font-color: #1D4B00;
    --secondary-button-border-color: #95958E;
    --secondary-button-text-color: #326916;
    --link-color: #326916;
    --title-font-color: #0C0C0B;
    --font-default-color: #0C0C0B;
    --widget-background-color: #ffffff;
    --box-border-color: #ffffff;
    --font-light-color: #77756F;
    --input-text-color: #0C0C0B;
    --input-border-color: #95958E;
    --border-default-color: #95958E;
    --input-background-color: #ffffff;
    --icon-default-color: #0C0C0B;
    --error-color: #B30C0C;
    --success-color: #326916;
    --base-focus-color: #0C0C0B;
    --page-background-color: #f6f6f4;
    --font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-bold-weight: 700;
    --font-default-weight: 400;
    --default-font-size: 16px;
    --title-font-size: 1.125rem;
    --button-height: 44px;
    --input-height: 44px;
    --button-border-radius: 9999px;
    --input-border-radius: 8px;
    --border-radius-outer: 16px;
    --box-border-width: 0px;
    --input-border-width: 1px;
    --button-border-width: 1px;
    --logo-height: 52px;
    --prompt-width: 500px;
    --hover-transparency-value: 0.08;
}

/* ===== Reset ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: var(--font-family);
    font-size: var(--default-font-size);
    background: var(--page-background-color);
    color: var(--font-default-color);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--link-color);
}

/* ===== Header ===== */
.knz-header {
    display: block;
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--widget-background-color);
    text-align: center;
    height: 50px;
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid #dddbd5;
}

.knz-header__back {
    display: inline-block;
    cursor: pointer;
    position: absolute;
    left: 0;
    margin-left: 12px;
    width: 24px;
    height: 24px;
    color: var(--link-color);
    text-decoration: none;
}

.knz-header__back svg {
    width: 100%;
    height: 100%;
    display: block;
}

.knz-header__logo-link {
    display: none;
    outline: none !important;
    text-decoration: none;
}

.knz-header__logo-img {
    height: 48px;
}

.knz-header__help-link {
    position: absolute;
    right: 0;
    margin-right: 12px;
    color: var(--link-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: var(--font-bold-weight);
}

.knz-header__help-link:hover {
    text-decoration: underline;
}

/* Desktop header */
@media (min-width: 601px) {
    .knz-header {
        height: 72px;
    }

    .knz-header__logo-link {
        display: inline-block;
    }

    .knz-header__back {
        margin-top: 12px;
    }

    .knz-header__help-link {
        font-size: 14px;
        margin-top: 12px;
    }
}

/* ===== Main Content ===== */
.main-widget {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 72px);
    padding: 0;
}

.prompt-box-outer {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0;
}

.prompt-box-inner {
    width: var(--prompt-width);
    max-width: 100%;
    padding: 64px 12px 24px;
}

.prompt-content {
    position: relative;
    background: var(--widget-background-color);
    border: var(--box-border-width) solid var(--box-border-color);
    border-radius: var(--border-radius-outer);
    padding: 32px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* ===== Prompt Header ===== */
.prompt-header {
    text-align: center;
    margin-bottom: 0;
}

.prompt-logo-center {
    display: block;
    height: var(--logo-height);
    margin: 0 auto 16px auto;
}

/* On desktop the center logo is hidden (header logo shows instead) */
@media (min-width: 601px) {
    .prompt-logo-center {
        display: none;
    }
}

.prompt-title {
    font-size: var(--title-font-size);
    font-weight: var(--font-bold-weight);
    color: var(--title-font-color);
    margin-bottom: 8px;
    line-height: 1.4;
}

.prompt-description {
    font-size: 0.875rem;
    font-weight: var(--font-default-weight);
    color: var(--font-default-color);
    margin-bottom: 24px;
    line-height: 1.5;
}

.prompt-description p {
    margin: 0;
}

/* ===== Form ===== */
.prompt-form-area {
    font-size: 0.875rem;
    font-weight: var(--font-default-weight);
}

.login-form {
    display: block;
}

.form-fields {
    margin-bottom: 0;
}

/* ===== Input Field ===== */
.input-wrapper {
    margin-bottom: 0;
}

.ulp-field {
    position: relative;
    margin-bottom: 4px;
}

.input-field {
    width: 100%;
    height: var(--input-height);
    padding: 0 12px;
    border: var(--input-border-width) solid var(--input-border-color);
    border-radius: var(--input-border-radius);
    font-size: 1rem;
    font-family: var(--font-family);
    color: var(--input-text-color);
    background-color: var(--input-background-color);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    line-height: normal;
}

.input-field::placeholder {
    color: var(--font-light-color);
    font-size: 0.875rem;
    opacity: 1;
}

.input-field:focus {
    border-color: var(--base-focus-color);
    box-shadow: 0 0 0 3px rgba(12, 12, 11, 0.15);
}

.has-error .input-field {
    border-color: var(--error-color);
}

.has-error .input-field::placeholder {
    color: var(--error-color);
}

.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 8px;
    display: flex;
    align-items: flex-start;
}

/* ===== Links ===== */
#ulp-container-form-content-end {
    margin-top: 12px;
    margin-bottom: 16px;
}

#ulp-container-form-content-end p {
    margin: 0;
}

.forgot-password-link {
    font-size: 0.875rem;
    font-weight: var(--font-bold-weight) !important;
    color: var(--link-color);
    text-decoration: underline;
}

.forgot-password-link:hover {
    text-decoration: none;
}

/* ===== Button ===== */
.button-container {
    margin-top: 0;
    margin-bottom: 0;
}

.btn-primary {
    display: block;
    width: 100%;
    height: var(--button-height);
    background-color: var(--primary-color);
    color: var(--button-font-color);
    border: var(--button-border-width) solid var(--primary-color);
    border-radius: var(--button-border-radius);
    font-size: 0.875rem;
    font-weight: var(--font-bold-weight);
    font-family: var(--font-family);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    line-height: 1;
    text-align: center;
}

.btn-primary:hover {
    background-color: #a8d63a;
    border-color: #a8d63a;
}

.btn-primary:active {
    background-color: #9bc732;
    border-color: #9bc732;
}

.btn-primary:focus-visible {
    outline: 2px solid var(--base-focus-color);
    outline-offset: 2px;
}

.btn-primary:disabled {
    background-color: #f2f9e1;
    border-color: #f2f9e1;
    color: #a1ce3f;
    cursor: not-allowed;
}

/* ===== Footer Links ===== */
#ulp-container-form-footer-start {
    text-align: left;
}

#ulp-container-form-footer-start p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--font-default-color);
}

.register-link {
    font-size: 0.875rem;
    font-weight: var(--font-bold-weight) !important;
    color: var(--link-color);
    text-decoration: underline;
}

.register-link:hover {
    text-decoration: none;
}

/* ===== Step 2: Email Display Box ===== */
.email-display-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    height: var(--input-height);
    border: var(--input-border-width) solid var(--input-border-color);
    border-radius: var(--input-border-radius);
    background: var(--input-background-color);
    margin-bottom: 8px;
}

.email-display-text {
    font-size: 0.875rem;
    font-weight: var(--font-default-weight);
    color: var(--font-default-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
}

.edit-email-link {
    font-size: 0.875rem;
    font-weight: var(--font-bold-weight);
    color: var(--link-color);
    text-decoration: underline;
    white-space: nowrap;
    flex-shrink: 0;
}

.edit-email-link:hover {
    text-decoration: none;
}

/* ===== Step 2: Password Field ===== */
.password-field {
    margin-bottom: 4px;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .input-field {
    padding-right: 44px;
}

.password-toggle-btn {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--font-light-color);
}

.password-toggle-btn:hover {
    color: var(--link-color);
}

.password-toggle-btn .eye-icon {
    width: 20px;
    height: 20px;
}

/* ===== Mobile Adjustments ===== */
@media (max-width: 600px) {
    .prompt-box-inner {
        padding: 16px 0;
        width: 100%;
    }

    .prompt-content {
        border-radius: 0;
        box-shadow: none;
        padding: 24px 16px;
    }

    .knz-header {
        height: 50px;
    }

    .main-widget {
        min-height: calc(100vh - 50px);
    }
}

/* ===== Loading Spinner ===== */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
