/* HostPerez DNS panel: same visual language as the HostPerez webmail */

:root {
    --bg: #f6f8fc;
    --card: #ffffff;
    --ink: #1f1f1f;
    --muted: #5f6368;
    --line: #e0e3e7;
    --line-soft: #eef0f3;
    --blue: #0b57d0;
    --blue-dark: #0842a0;
    --blue-soft: #d3e3fd;
    --blue-tint: #eef3fd;
    --orange: #ff5a1f;
    --green: #188038;
    --green-soft: #e6f4ea;
    --red: #d93025;
    --red-soft: #fce8e6;
    --amber: #b06000;
    --amber-soft: #fef7e0;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(60, 64, 67, .15), 0 1px 3px 1px rgba(60, 64, 67, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.5 Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
}

h1, h2 {
    margin: 0 0 .25rem;
    line-height: 1.25;
    font-weight: 600;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.1rem; }

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

code {
    font: 500 .9rem ui-monospace, SFMono-Regular, Consolas, monospace;
    background: var(--blue-tint);
    padding: .15rem .45rem;
    border-radius: 6px;
}

.muted { color: var(--muted); }

/*** Top bar ***/

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .65rem 1.25rem;
    background: rgba(246, 248, 252, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--ink);
    text-decoration: none;
}

.brand-name { font-size: 1.2rem; font-weight: 700; }
.brand-name b { color: var(--orange); }

.brand-app {
    padding: .1rem .6rem;
    border-radius: 999px;
    background: var(--blue-soft);
    color: #001d35;
    font-size: .8rem;
    font-weight: 600;
}

.account {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.account form { margin: 0; }
.account-name { font-weight: 600; }

.badge {
    padding: .1rem .55rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: .78rem;
}

/*** Layout ***/

.page {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.section-title { margin: 2rem 0 .75rem; }

.back {
    display: inline-block;
    margin-bottom: .75rem;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
}

.back:hover { color: var(--ink); }

/*** Cards ***/

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.4rem;
    margin-bottom: 1rem;
}

.card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: .75rem;
}

.card.notice {
    background: var(--amber-soft);
    box-shadow: none;
    border: 1px solid #f6e3a8;
}

.card.empty { text-align: center; padding: 2.5rem; }

.notice-card {
    width: 100%;
    max-width: 460px;
    text-align: center;
}

/*** Login ***/

.login {
    width: 100%;
    max-width: 400px;
    padding: 2.25rem 2rem 2rem;
    border-radius: 24px;
    text-align: center;
}

.login h1 { font-size: 1.45rem; }
.login h1 span { color: var(--orange); }

.login-logo { margin-bottom: 1rem; }

.login form { margin-top: 1.25rem; text-align: left; }

.login label {
    display: block;
    margin: .9rem 0 .35rem;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 500;
}

.login .btn-block { margin-top: 1.5rem; }

/*** Forms ***/

input, select {
    width: 100%;
    padding: .65rem .8rem;
    border: 1px solid #c4c7c5;
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(11, 87, 208, .18);
}

.fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .75rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    min-width: 120px;
    flex: 1 1 140px;
}

.field.grow { flex: 3 1 260px; }
.field.small { flex: 0 1 110px; min-width: 90px; }

.field > span {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 500;
}

.check {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .6rem 0;
    white-space: nowrap;
}

.check input { width: auto; }

.hint {
    margin: .75rem 0 1rem;
    color: var(--muted);
    font-size: .85rem;
}

.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: 1rem;
}

[hidden] { display: none !important; }

/*** Buttons ***/

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .6rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font-family: inherit;
    font-size: .95rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }

.btn-secondary { border-color: #c4c7c5; background: #fff; }
.btn-secondary:hover { background: var(--blue-tint); }

.btn-ghost { color: var(--muted); }
.btn-ghost:hover { background: #e9eef6; color: var(--ink); }

.btn-block { width: 100%; padding: .75rem 1rem; }

.btn-small {
    padding: .3rem .75rem;
    border-color: var(--line);
    background: #fff;
    font-size: .82rem;
}

.btn-small:hover { background: var(--blue-tint); }

.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: #f4c7c3; }

/*** Flash messages ***/

.flash {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 1rem;
    padding: .8rem 1rem;
    border-radius: 12px;
    font-weight: 500;
}

.center .flash { max-width: 400px; }

.flash-success { background: var(--green-soft); color: #0d652d; }
.flash-error { background: var(--red-soft); color: #a50e0e; }
.flash-info { background: var(--blue-tint); color: #001d35; }

/*** Domains ***/

.domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.card.domain {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin: 0;
    color: var(--ink);
    text-decoration: none;
    transition: box-shadow .15s ease, transform .15s ease;
}

.card.domain:hover {
    box-shadow: 0 4px 8px 3px rgba(60, 64, 67, .12), 0 1px 3px rgba(60, 64, 67, .25);
    transform: translateY(-1px);
}

.domain-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--blue-soft);
    color: #001d35;
    font-weight: 700;
    font-size: 1.1rem;
}

.domain-body {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    min-width: 0;
    flex: 1;
}

.domain-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.chevron { color: var(--muted); font-size: 1.4rem; }

.pill {
    align-self: flex-start;
    display: inline-block;
    padding: .1rem .6rem;
    border-radius: 999px;
    background: #f1f3f4;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 500;
}

.pill-active { background: var(--green-soft); color: #0d652d; }
.pill-pending, .pill-initializing { background: var(--amber-soft); color: var(--amber); }

.rows .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .6rem 0;
    border-bottom: 1px solid var(--line-soft);
}

.rows .row:last-child { border-bottom: 0; }
.rows form { margin: 0; }
.row-main { font-weight: 500; }

/*** Records ***/

.table-wrap { overflow-x: auto; }

table.records {
    width: 100%;
    border-collapse: collapse;
}

.records th {
    padding: .5rem .6rem;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: .8rem;
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
}

.records td {
    padding: .6rem;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}

.records tbody tr:hover td { background: #f8fafd; }

.records .name { font-weight: 500; white-space: nowrap; }

.records .content {
    max-width: 420px;
    overflow-wrap: anywhere;
    font: .88rem ui-monospace, SFMono-Regular, Consolas, monospace;
}

.records .actions {
    display: flex;
    justify-content: flex-end;
    gap: .4rem;
    white-space: nowrap;
}

.records .actions form { margin: 0; }
.actions-col { width: 1%; }

.type {
    display: inline-block;
    min-width: 3.2em;
    padding: .1rem .45rem;
    border-radius: 6px;
    background: #f1f3f4;
    color: #3c4043;
    font: 600 .75rem ui-monospace, SFMono-Regular, Consolas, monospace;
    text-align: center;
}

.type-a, .type-aaaa { background: var(--blue-soft); color: #001d35; }
.type-cname { background: #e8def8; color: #1d192b; }
.type-mx { background: #ffd8e4; color: #31111d; }
.type-txt { background: #dde3ea; color: #1a1c1e; }

.prio {
    padding: .05rem .4rem;
    border-radius: 6px;
    background: #f1f3f4;
    font-size: .78rem;
}

.proxy {
    padding: .1rem .55rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 500;
    white-space: nowrap;
}

.proxy.on { background: #fde7d9; color: #8a3b00; }
.proxy.off { background: #f1f3f4; color: var(--muted); }

.ns {
    list-style: none;
    margin: .75rem 0 0;
    padding: 0;
}

.ns li {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .5rem;
}

/*** Activity ***/

.activity {
    list-style: none;
    margin: .5rem 0 0;
    padding: 0;
}

.activity li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
    padding: .5rem 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: .9rem;
}

.activity li:last-child { border-bottom: 0; }
.activity .when { color: var(--muted); min-width: 8.5rem; }

/*** Small screens ***/

@media (max-width: 640px) {
    .topbar { padding: .6rem 1rem; }
    .brand-app, .badge { display: none; }
    .page { padding: 1rem 1rem 2rem; }
    .page-head { flex-direction: column; }
    .card { padding: 1rem; }
    .records .content { max-width: 220px; }
}
