/**
 * Rental System – Header-Elemente, die auf allen Seiten erscheinen können:
 * [rental_search_bar] und [rental_user_greeting] (inkl. Login-Dialog)
 * Farben/Schrift: base.css
 */

/* ---------- Suchleiste ---------- */

.rental-search-bar-wrapper {
    width: 100%;
    max-width: 260px;
    margin: 0;
    padding: 0;
    font-family: var(--rs-font);
}

.rental-search-bar-form {
    margin: 0;
}

.rental-search-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 4px 0 12px;
    background: var(--rs-bg);
    border: 1px solid var(--rs-line);
    border-radius: var(--rs-radius);
    color: var(--rs-muted);
    box-shadow: none;
}

.rental-search-bar-container:focus-within {
    border-color: var(--rs-green);
    background: var(--rs-white);
    box-shadow: 0 0 0 1px var(--rs-green);
}

.rental-search-bar-icon {
    flex-shrink: 0;
}

.rental-search-bar-wrapper .rental-search-bar-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-family: var(--rs-font);
    font-size: 14px;
    color: var(--rs-ink);
    outline: none;
}

.rental-search-bar-wrapper .rental-search-bar-input::placeholder {
    color: var(--rs-muted);
}

/* Im Header ist der Button nur für Tastatur/Screenreader nötig – Enter reicht */
.rental-search-bar-wrapper--compact .rental-search-bar-button {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.rental-search-bar-wrapper--compact .rental-search-bar-button:focus {
    position: static;
    width: auto;
    height: 28px;
    clip: auto;
}

.rental-search-bar-wrapper .rental-search-bar-button {
    flex-shrink: 0;
    height: 28px;
    margin: 0;
    padding: 0 12px;
    border: 0;
    border-radius: var(--rs-radius-sm);
    background: var(--rs-green);
    box-shadow: none;
    color: var(--rs-white);
    font-family: var(--rs-font);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transform: none;
}

.rental-search-bar-wrapper .rental-search-bar-button:hover {
    background: var(--rs-green-dark);
    box-shadow: none;
    color: var(--rs-white);
    transform: none;
}

/* Große Variante auf der Ergebnisseite */
.rental-search-results-page .rental-search-bar-wrapper {
    max-width: 560px;
}

.rental-search-results-page .rental-search-bar-container {
    height: 44px;
    background: var(--rs-white);
    border-color: var(--rs-line-strong);
}

.rental-search-results-page .rental-search-bar-button {
    height: 34px;
    padding: 0 16px;
}

/* ---------- Begrüßung / Login ---------- */

.rental-user-greeting {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--rs-font);
    font-size: 14px;
    color: var(--rs-ink);
}

.rental-user-avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--rs-green-soft);
    color: var(--rs-green-dark);
    font-size: 12px;
    font-weight: 600;
}

.rental-user-greeting__text {
    font-weight: 500;
    white-space: nowrap;
}

.rental-user-greeting .rental-user-greeting__button {
    display: inline-flex;
    align-items: center;
    height: 36px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--rs-line-strong);
    border-radius: var(--rs-radius);
    background: var(--rs-white);
    box-shadow: none;
    color: var(--rs-ink);
    font-family: var(--rs-font);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.rental-user-greeting .rental-user-greeting__button:hover,
.rental-user-greeting .rental-user-greeting__button:focus {
    border-color: var(--rs-faint);
    background: var(--rs-white);
    color: var(--rs-ink);
    text-decoration: none;
}

.rental-user-greeting .rental-user-greeting__button--quiet {
    height: 30px;
    padding: 0 10px;
    font-size: 13px;
    color: var(--rs-muted);
}

/* Login-Dialog */
.rental-login-dialog {
    width: min(400px, calc(100vw - 32px));
    padding: 32px 28px 24px;
    border: 1px solid var(--rs-line);
    border-radius: var(--rs-radius-lg);
    background: var(--rs-white);
    box-shadow: var(--rs-shadow-dialog);
    color: var(--rs-ink);
    font-family: var(--rs-font);
}

.rental-login-dialog::backdrop {
    background: rgba(23, 25, 31, .45);
}

.rental-login-dialog__title {
    margin: 0 0 4px;
    font-family: var(--rs-font);
    font-size: 22px;
    font-weight: 600;
    color: var(--rs-ink);
}

.rental-login-dialog__lead {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--rs-muted);
}

.rental-login-dialog .rental-login-dialog__close {
    position: absolute;
    box-shadow: none;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--rs-radius);
    background: transparent;
    color: var(--rs-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.rental-login-dialog .rental-login-dialog__close:hover,
.rental-login-dialog .rental-login-dialog__close:focus {
    background: var(--rs-hover);
    color: var(--rs-ink);
}

.rental-login-dialog form p {
    margin: 0 0 14px;
}

.rental-login-dialog label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--rs-ink);
}

.rental-login-dialog input[type="text"],
.rental-login-dialog input[type="password"] {
    width: 100%;
    height: 42px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--rs-line-strong);
    border-radius: var(--rs-radius);
    background: var(--rs-white);
    box-sizing: border-box;
    font-family: var(--rs-font);
    font-size: 15px;
    color: var(--rs-ink);
}

.rental-login-dialog input[type="text"]:focus,
.rental-login-dialog input[type="password"]:focus {
    border-color: var(--rs-green);
    outline: 2px solid var(--rs-green);
    outline-offset: 1px;
}

.rental-login-dialog .login-remember label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    color: var(--rs-ink-2);
}

.rental-login-dialog .login-remember input {
    margin: 0;
    accent-color: var(--rs-green);
}

.rental-login-dialog input[type="submit"] {
    width: 100%;
    height: 44px;
    margin-top: 6px;
    border: 0;
    border-radius: var(--rs-radius);
    background: var(--rs-green);
    color: var(--rs-white);
    font-family: var(--rs-font);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.rental-login-dialog input[type="submit"]:hover {
    background: var(--rs-green-dark);
}

.rental-login-dialog__lost {
    margin: 16px 0 0;
    font-size: 13px;
    text-align: center;
}

.rental-login-dialog a {
    color: var(--rs-green);
    text-decoration: none;
}

.rental-login-dialog a:hover {
    color: var(--rs-green-dark);
    text-decoration: underline;
}

.rental-login-dialog__hint {
    margin: 16px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--rs-line);
    font-size: 13px;
    color: var(--rs-muted);
    text-align: center;
    text-wrap: pretty;
}

@media (max-width: 600px) {
    .rental-search-bar-wrapper {
        max-width: none;
    }

    .rental-user-greeting__text {
        display: none;
    }
}
