/* ===== Allgemein ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: #222; }
img { max-width: 100%; }

/* Alle Formularfelder mind. 16px, damit iOS/Safari beim Fokussieren nicht zoomt */
input, select, textarea, button { font-size: 16px; }

/* ===== Frontend / Onpager ===== */
.frontend-body { background: #ffffff; }

.site-header {
    position: relative;
    background-size: cover;
    background-position: center;
    min-height: 220px;
    display: flex;
    align-items: flex-end;
}
.header-overlay h1 {
    color: #fff;
    margin: 0;
    font-size: 2rem;
}

.onpager { max-width: 1100px; margin: 0 auto; padding: 24px; background: #fff; }
.empty-notice { text-align: center; color: #666; padding: 40px 0; }

.welcome-block {
    margin-bottom: 20px;
    padding: 0 4px;
}
.welcome-heading {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: #1f2a44;
    overflow-wrap: break-word;
    word-break: break-word;
}
.welcome-text {
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    color: #333;
    overflow-wrap: break-word;
    word-break: break-word;
}
.welcome-text p, .welcome-text div { margin: 0 0 10px; }
.welcome-text p:last-child, .welcome-text div:last-child { margin-bottom: 0; }

.domain-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
}
@media (max-width: 900px) {
    .domain-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .domain-grid { grid-template-columns: 1fr; gap: 16px; }
}

.domain-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 16px 14px;
    background: #fafafa;
    align-self: start;
    text-align: center;
}
.domain-name { font-weight: bold; word-break: break-all; color: #581654; }

.bid-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #bbb;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    font-size: 16px; /* verhindert Auto-Zoom bei Fokus auf iPhone/Safari */
}
.bid-input.bid-red { background-color: #ffd6d6; border-color: #e08a8a; }
.bid-input.bid-green { background-color: #d7f5da; border-color: #7fc98a; }
.bid-total-hint { font-size: 0.78rem; color: #555; margin: -4px 0 10px; }
.bid-hint { font-size: 0.8rem; color: #c0392b; min-height: 1.1em; margin-bottom: 6px; }

.btn-purple {
    padding: 8px 14px;
    min-height: 40px;
    border: none;
    border-radius: 4px;
    background: #581654;
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
}
.btn-purple:hover { background: #430f40; }
.btn-purple:active { background: #360c33; }

/* "Angebot senden" bewusst dezenter als "Absenden" im Overlay, damit die
   Seite nicht überladen wirkt */
.btn-send-bid {
    width: 100%;
    background: #8a8a8a;
    padding: 6px 12px;
    min-height: 34px;
    font-size: 0.85rem;
}
.btn-send-bid:hover { background: #767676; }
.btn-send-bid:active { background: #666666; }

/* ===== Overlay / Modal "Angebot + Angaben zum Bieter" ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
}
.modal-overlay[hidden] { display: none; }
body.modal-open { overflow: hidden; }

.modal-box {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 22px 20px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.modal-box h3 {
    margin: 0 0 14px;
    font-size: 1.05rem;
    padding-right: 24px;
    overflow-wrap: break-word;
}
.modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 4px;
}
.modal-close:hover { color: #222; }

.bidder-details-form label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 10px;
}
.bidder-details-form input,
.bidder-details-form textarea {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-family: inherit;
    font-size: 16px;
}
.captcha-code {
    display: inline-block;
    font-weight: bold;
    letter-spacing: 4px;
    background: #eee;
    padding: 2px 10px;
    border-radius: 4px;
    margin-left: 6px;
}
.bidder-form-msg { font-size: 0.85rem; margin-top: 8px; }
.msg-success { color: #1e7e34; }
.msg-error { color: #c0392b; }

@media (max-width: 480px) {
    .welcome-heading { font-size: 1.15rem; }
    .welcome-text { font-size: 0.85rem; }
    .modal-box { padding: 18px 14px; max-width: 100%; }
}

/* ===== Adminbereich ===== */
.admin-body { background: #f2f4f7; }
.admin-header {
    background: #1f2a44;
    color: #fff;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-header nav a { color: #fff; margin-left: 16px; text-decoration: none; }
.admin-header nav a:hover { text-decoration: underline; }

.admin-main { max-width: 1100px; margin: 0 auto; padding: 20px; }

.card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 18px 20px;
    margin-bottom: 20px;
}
.card h2 { margin-top: 0; font-size: 1.15rem; }

.domain-form, .smtp-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; }
.domain-form label, .smtp-form label { display: flex; flex-direction: column; font-size: 0.85rem; gap: 4px; }
.domain-form input, .smtp-form input, .smtp-form select {
    padding: 7px 9px; border: 1px solid #bbb; border-radius: 4px; font-family: inherit;
}
/* Domainname, Registrierdatum und Abrechnungsdatum bei ausreichender Breite in einer Zeile */
.form-row-3 {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 20px;
}
@media (max-width: 900px) {
    .form-row-3 { grid-template-columns: 1fr; }
}
.checkbox-label { flex-direction: row !important; align-items: center; gap: 8px !important; }
.checkbox-label input { width: auto; }

.form-actions { grid-column: 1 / -1; margin-top: 6px; }
.form-actions button {
    padding: 9px 18px; border: none; border-radius: 4px;
    background: #2d6cdf; color: #fff; cursor: pointer; font-size: 0.95rem;
}
.form-actions button:hover { background: #1e56bd; }
.btn-secondary {
    display: inline-block; margin-left: 10px; padding: 9px 18px;
    background: #ddd; color: #333; border-radius: 4px; text-decoration: none;
}
.btn-danger { background: #c0392b; color: #fff; border: none; padding: 6px 10px; border-radius: 4px; cursor: pointer; }
.btn-danger:hover { background: #96291e; }

.tld-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.tld-chip {
    background: #e8edfb; color: #1f2a44; padding: 4px 12px;
    border-radius: 14px; font-size: 0.85rem; font-weight: bold;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid #eee; text-align: left; font-size: 0.9rem; }
th { background: #f5f6f8; }
.row-actions { display: flex; gap: 10px; align-items: center; }
.row-actions form { display: inline; }

.restlaufzeit-warnung { background-color: #ffb347; font-weight: bold; }
.restlaufzeit-warnung-input { background-color: #ffb347 !important; }

.domain-inaktiv { background-color: #e2e2e2; color: #777; }
.domain-inaktiv td { background-color: #e2e2e2; }

.hint-text { font-size: 0.82rem; color: #666; margin-top: -6px; }
.content-form { display: grid; grid-template-columns: 1fr; gap: 12px; max-width: 640px; }
.content-form label { display: flex; flex-direction: column; font-size: 0.85rem; gap: 4px; }
.content-form input, .content-form textarea {
    padding: 7px 9px; border: 1px solid #bbb; border-radius: 4px; font-family: inherit; resize: vertical;
}

.login-box {
    max-width: 380px; margin: 80px auto; background: #fff; padding: 28px;
    border-radius: 8px; border: 1px solid #e0e0e0;
}
.login-box h1 { margin-top: 0; font-size: 1.3rem; }
.login-box label { display: block; margin-bottom: 14px; font-size: 0.9rem; }
.login-box input { width: 100%; padding: 8px; margin-top: 4px; border: 1px solid #bbb; border-radius: 4px; }
.login-box button {
    width: 100%; padding: 10px; border: none; border-radius: 4px;
    background: #2d6cdf; color: #fff; font-size: 1rem; cursor: pointer;
}

.error { color: #c0392b; }
.success { color: #1e7e34; }

/* ===== Responsive-Feinschliff (Tablet / iPhone) ===== */
@media (max-width: 900px) {
    .domain-form, .smtp-form { grid-template-columns: 1fr; }
    .admin-main { padding: 16px; }
}

@media (max-width: 600px) {
    .site-header { min-height: 160px; }
    .header-overlay { padding: 16px 18px; }
    .header-overlay h1 { font-size: 1.4rem; }
    .onpager { padding: 16px; }
    .welcome-heading { font-size: 1.2rem; }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 16px;
    }
    .admin-header nav a { margin-left: 0; margin-right: 16px; }
    .card { padding: 14px; }
    .login-box { margin: 40px auto; max-width: 90%; }
}

/* ===== SMTP-Verbindungstest ===== */
.btn-outline {
    padding: 9px 18px;
    border: 1px solid #581654;
    border-radius: 4px;
    background: #fff;
    color: #581654;
    cursor: pointer;
    font-size: 0.95rem;
}
.btn-outline:hover { background: #f4eef4; }
.smtp-test-result { grid-column: 1 / -1; font-size: 0.88rem; margin: 4px 0 0; }
.smtp-test-result.test-success { color: #1e7e34; font-weight: bold; }
.smtp-test-result.test-error { color: #c0392b; font-weight: bold; }

/* ===== Admin-Overlay (Drucken / Passwort ändern) ===== */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
}
.admin-modal-overlay[hidden] { display: none; }

.admin-modal-box {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 640px;
    height: 85vh;
    max-height: 720px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}
.admin-modal-box iframe {
    flex: 1;
    border: 0;
    width: 100%;
    height: 100%;
    background: #f2f4f7;
}
.admin-modal-box .modal-close {
    position: absolute;
    top: 6px;
    right: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: #666;
    z-index: 2;
    padding: 2px 9px;
}
.admin-modal-box .modal-close:hover { color: #222; }

/* Innerhalb des Overlays eingebettete Seiten (embed=1) etwas kompakter darstellen */
.embed-body .admin-main { padding: 44px 16px 16px; max-width: 100%; }
.embed-body .card { border: none; box-shadow: none; padding: 4px; }

@media (max-width: 600px) {
    .admin-modal-box { height: 92vh; }
}

.mail-log-status {
    font-size: 0.85rem;
    padding: 8px 10px;
    border-radius: 4px;
    background: #f4f4f4;
    margin-bottom: 12px;
}
.mail-log-status.test-success { background: #e7f6ea; color: #1e7e34; }
.mail-log-status.test-error { background: #fbe9e7; color: #c0392b; }
.mail-log-status small { font-weight: normal; color: inherit; opacity: 0.9; word-break: break-word; }

/* ===== Rich-Text-Editor (Admin) ===== */
.rich-editor {
    border: 1px solid #bbb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}
.rich-toolbar {
    display: flex;
    gap: 4px;
    background: #f2f2f2;
    padding: 6px;
    border-bottom: 1px solid #ddd;
}
.rich-toolbar button {
    width: 32px;
    height: 30px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
}
.rich-toolbar button:hover { background: #eee; }
.rich-editable {
    min-height: 90px;
    max-height: 260px;
    overflow-y: auto;
    padding: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    outline: none;
}
.rich-editable-large { min-height: 160px; max-height: 420px; }
.rich-editable:empty::before { content: attr(data-placeholder); color: #999; }
.rich-editable p, .rich-editable div { margin: 0 0 8px; }

.pages-form { display: block; }
.page-fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 14px 16px 16px;
    margin-bottom: 18px;
}
.page-fieldset legend { font-weight: bold; padding: 0 6px; color: #1f2a44; }
.page-fieldset label {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    gap: 4px;
    margin-bottom: 8px;
}
.page-fieldset input[type="text"] {
    padding: 7px 9px; border: 1px solid #bbb; border-radius: 4px; font-family: inherit;
}

/* ===== Frontend-Menü (Impressum/Info/Datenschutz) ===== */
.header-overlay {
    background: rgba(0, 0, 0, 0.45);
    width: 100%;
    padding: 24px 32px;
}
/* Eigenständig rechts oben im Header positioniert – unabhängig von der
   unten sitzenden Titel-Leiste (.header-overlay) */
.site-nav {
    position: absolute;
    top: 14px;
    right: 15px;
    max-width: 65%;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}
.site-nav a {
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}
.site-nav a:hover { text-decoration: underline; }
.site-nav a.site-nav-home {
    padding: 2px;
}
.site-nav a.site-nav-home:hover {
    text-decoration: none;
    opacity: 0.75;
}
.site-nav a.site-nav-home svg { display: block; }

.page-title { font-size: 1.4rem; margin: 0 0 16px; color: #1f2a44; overflow-wrap: break-word; }
.page-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
    overflow-wrap: break-word;
    word-break: break-word;
}
.page-content p, .page-content div { margin: 0 0 14px; }
.page-content ul, .page-content ol { margin: 0 0 14px 22px; }

@media (max-width: 600px) {
    .site-nav {
        top: 8px;
        left: 12px;
        right: 15px;
        max-width: none;
        justify-content: center;
        gap: 8px;
        font-size: 0.78rem;
    }
}
