:root {
    --ink: #0b1728;
    --ink-soft: #15253a;
    --teal: #19b89c;
    --teal-dark: #0d8e78;
    --mint: #dff8f1;
    --paper: #f4f7f6;
    --white: #ffffff;
    --line: #dce5e3;
    --muted: #63716f;
    --danger: #dc4c5d;
    --warning-bg: #fff4db;
    --success-bg: #dcf8ef;
    --shadow: 0 18px 50px rgba(11, 23, 40, .09);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

button,
input,
textarea {
    font: inherit;
}

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

.container {
    width: min(1160px, calc(100% - 40px));
    margin-inline: auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    position: relative;
    z-index: 10;
    background: var(--ink);
    color: var(--white);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -.02em;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 11px;
    color: var(--ink);
    background: var(--teal);
    box-shadow: 0 8px 22px rgba(25, 184, 156, .24);
}

.header-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 11px;
    color: #eaf3f1;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .2s ease, border-color .2s ease;
}

.header-link:hover {
    background: rgba(255, 255, 255, .09);
    border-color: rgba(255, 255, 255, .35);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.compact-public-header {
    background: var(--white);
    border-bottom: 1px solid var(--line);
}

.compact-header-inner {
    padding-block: 20px;
}

.compact-header-inner h1 {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.2;
    letter-spacing: -.035em;
}

.compact-header-inner p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .88rem;
}

.danger-link {
    color: #ffdce1;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 82px 0 90px;
    background:
        radial-gradient(circle at 82% 12%, rgba(25, 184, 156, .2), transparent 32%),
        linear-gradient(135deg, var(--ink) 0%, #10263c 100%);
    color: var(--white);
}

.hero::after {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    right: -130px;
    bottom: -210px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50%;
    box-shadow: 0 0 0 58px rgba(255, 255, 255, .025), 0 0 0 116px rgba(255, 255, 255, .02);
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
    gap: 70px;
    align-items: end;
}

.eyebrow,
.section-kicker {
    margin: 0 0 12px;
    color: var(--teal);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .15em;
}

.hero h1,
.admin-intro h1 {
    margin: 0;
    max-width: 760px;
    font-size: clamp(2.2rem, 5.8vw, 4.7rem);
    line-height: 1.03;
    letter-spacing: -.055em;
}

.hero-copy {
    max-width: 640px;
    margin: 25px 0 0;
    color: #b9c8c6;
    font-size: 1.05rem;
}

.summary-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .07);
    backdrop-filter: blur(12px);
}

.summary-card div {
    padding: 4px 20px;
}

.summary-card div + div {
    border-left: 1px solid rgba(255, 255, 255, .14);
}

.summary-card strong,
.summary-card span {
    display: block;
}

.summary-card strong {
    font-size: 2rem;
    line-height: 1.1;
}

.summary-card span {
    margin-top: 6px;
    color: #b9c8c6;
    font-size: .8rem;
}

.directory-section {
    padding: 70px 0 86px;
}

.compact-directory {
    padding-top: 28px;
}

.compact-toolbar {
    align-items: center;
    margin-bottom: 18px;
}

.domain-total {
    margin: 0;
    color: var(--muted);
    font-size: .88rem;
}

.domain-total strong {
    color: var(--ink);
}

.directory-toolbar,
.admin-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.directory-toolbar h2,
.admin-toolbar h2 {
    margin: 0;
    font-size: clamp(1.6rem, 4vw, 2.35rem);
    letter-spacing: -.04em;
}

.search-box {
    width: min(100%, 340px);
    height: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--white);
    box-shadow: 0 7px 20px rgba(11, 23, 40, .04);
}

.search-box:focus-within {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(25, 184, 156, .12);
}

.search-box svg {
    width: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--muted);
    stroke-linecap: round;
    stroke-width: 2;
}

.search-box input {
    min-width: 0;
    width: 100%;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
}

.domain-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
}

.domain-list-head,
.domain-row {
    display: grid;
    grid-template-columns: 70px minmax(190px, 280px) minmax(0, 1fr);
}

.domain-list-head {
    padding: 14px 22px;
    color: #778582;
    background: #eaf0ee;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.domain-row {
    min-height: 94px;
    align-items: center;
    padding: 20px 22px;
    border-top: 1px solid var(--line);
    transition: background .2s ease;
}

.domain-row:hover {
    background: #f8fbfa;
}

.domain-number {
    color: var(--teal-dark);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .08em;
}

.domain-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-size: 1.06rem;
    font-weight: 850;
    text-decoration: none;
    word-break: break-word;
}

.domain-name:hover {
    color: var(--teal-dark);
}

.domain-name svg {
    width: 16px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.domain-note {
    padding-left: 26px;
    border-left: 1px solid var(--line);
}

.domain-note p {
    margin: 0;
    color: #344440;
    overflow-wrap: anywhere;
}

.domain-note.is-empty p {
    color: #899592;
    font-style: italic;
}

.mobile-label {
    display: none;
}

.empty-state {
    padding: 48px 24px;
    border: 1px dashed #bac8c5;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .55);
    text-align: center;
}

.empty-state h3,
.empty-state p {
    margin: 0;
}

.empty-state p {
    margin-top: 7px;
    color: var(--muted);
}

.search-empty {
    margin-top: 20px;
}

.site-footer {
    padding: 26px 0;
    color: #99aaa7;
    background: var(--ink);
    font-size: .83rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

/* Admin */
.admin-body {
    background: #edf2f1;
}

.admin-main {
    padding: 56px 0 86px;
}

.admin-intro {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 44px;
}

.admin-intro h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
}

.admin-intro p:last-child {
    max-width: 650px;
    margin: 16px 0 0;
    color: var(--muted);
}

.admin-count {
    min-width: 180px;
    padding: 21px 24px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--white);
}

.admin-count strong,
.admin-count span {
    display: block;
}

.admin-count strong {
    font-size: 2rem;
    line-height: 1;
}

.admin-count span {
    margin-top: 7px;
    color: var(--muted);
    font-size: .8rem;
}

.admin-content {
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, .76);
}

.admin-toolbar p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .9rem;
}

.admin-domain-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.admin-domain-card {
    scroll-margin-top: 24px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: var(--white);
    box-shadow: 0 9px 24px rgba(11, 23, 40, .045);
}

.admin-domain-card:target {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(25, 184, 156, .13);
}

.admin-domain-title {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 17px;
}

.admin-domain-title .domain-number {
    width: 39px;
    height: 39px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 11px;
    background: var(--mint);
}

.admin-domain-title h3 {
    margin: -2px 0 1px;
    font-size: 1.08rem;
    overflow-wrap: anywhere;
}

.admin-domain-title a {
    color: var(--teal-dark);
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
}

.note-form label {
    display: block;
    margin-bottom: 7px;
    font-size: .78rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.note-form textarea,
.auth-form input {
    width: 100%;
    border: 1px solid #ccd8d5;
    border-radius: 12px;
    outline: 0;
    background: #fbfdfc;
    color: var(--ink);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.note-form textarea {
    min-height: 118px;
    padding: 13px 14px;
    resize: vertical;
    line-height: 1.5;
}

.note-form textarea:focus,
.auth-form input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(25, 184, 156, .12);
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 13px;
}

.save-hint {
    color: #84918f;
    font-size: .74rem;
}

.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 17px;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 850;
    text-decoration: none;
}

.primary-button {
    color: #041b17;
    background: var(--teal);
    box-shadow: 0 8px 18px rgba(25, 184, 156, .22);
}

.primary-button:hover {
    background: #24c9aa;
}

.alert {
    margin-bottom: 20px;
    padding: 13px 15px;
    border-radius: 12px;
    font-size: .9rem;
    font-weight: 700;
}

.alert-success {
    color: #0d674f;
    background: var(--success-bg);
    border: 1px solid #a9ead8;
}

.alert-error {
    color: #9f2737;
    background: #ffe8eb;
    border: 1px solid #ffc4cc;
}

/* Login dan setup */
.auth-body {
    min-height: 100vh;
    background: var(--ink);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(460px, .8fr);
}

.auth-panel {
    padding: clamp(30px, 6vw, 90px);
}

.auth-message-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    color: var(--white);
    background:
        radial-gradient(circle at 0 100%, rgba(25, 184, 156, .21), transparent 38%),
        var(--ink);
}

.auth-message-panel h1 {
    max-width: 700px;
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 5.2rem);
    line-height: 1.03;
    letter-spacing: -.055em;
}

.auth-message-panel p:last-child {
    max-width: 620px;
    color: #b8c7c5;
}

.back-link {
    color: #b8c7c5;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
}

.auth-form-panel {
    display: grid;
    place-items: center;
    background: var(--paper);
}

.auth-card {
    width: min(100%, 470px);
    padding: clamp(25px, 5vw, 42px);
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.auth-card h1,
.auth-card h2 {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.4rem);
    line-height: 1.15;
    letter-spacing: -.04em;
}

.auth-subtitle {
    margin: 10px 0 24px;
    color: var(--muted);
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form label span {
    display: block;
    margin-bottom: 7px;
    font-size: .82rem;
    font-weight: 800;
}

.auth-form input {
    height: 51px;
    padding: 0 14px;
}

.full-button {
    width: 100%;
    margin-top: 5px;
}

.setup-notice {
    margin: 22px 0 0;
    color: var(--muted);
    font-size: .83rem;
    text-align: center;
}

.setup-notice a {
    color: var(--teal-dark);
    font-weight: 800;
}

.single-auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 30px 20px;
    background:
        radial-gradient(circle at 20% 20%, rgba(25, 184, 156, .17), transparent 28%),
        var(--ink);
}

.setup-card {
    width: min(100%, 520px);
}

.dark-brand {
    margin-bottom: 38px;
    color: var(--ink);
}

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 42px;
    }

    .summary-card {
        max-width: 500px;
    }

    .admin-domain-grid {
        grid-template-columns: 1fr;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-message-panel {
        min-height: auto;
        gap: 60px;
        padding-bottom: 50px;
    }

    .auth-form-panel {
        min-height: 560px;
    }
}

@media (max-width: 720px) {
    .container {
        width: min(100% - 28px, 1160px);
    }

    .header-inner {
        min-height: 68px;
    }

    .brand {
        font-size: .94rem;
    }

    .brand-mark {
        width: 35px;
        height: 35px;
    }

    .header-link {
        min-height: 40px;
        padding: 7px 11px;
        font-size: .76rem;
    }

    .admin-header .header-inner {
        align-items: flex-start;
        flex-direction: column;
        padding-block: 15px;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .header-link {
        flex: 1;
    }

    .hero {
        padding: 56px 0 64px;
    }

    .compact-header-inner {
        padding-block: 15px;
    }

    .compact-header-inner h1 {
        font-size: 1.18rem;
    }

    .compact-header-inner p {
        margin-top: 2px;
        font-size: .76rem;
    }

    .hero h1 {
        font-size: clamp(2.1rem, 11vw, 3.5rem);
    }

    .summary-card {
        padding: 18px 10px;
    }

    .summary-card div {
        padding: 3px 13px;
    }

    .directory-section {
        padding: 50px 0 64px;
    }

    .compact-directory {
        padding-top: 18px;
    }

    .compact-toolbar {
        gap: 10px;
        margin-bottom: 13px;
    }

    .directory-toolbar,
    .admin-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .domain-list {
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: var(--white);
        box-shadow: 0 9px 24px rgba(11, 23, 40, .06);
    }

    .domain-list-head,
    .domain-row {
        grid-template-columns: 38px minmax(105px, .8fr) minmax(0, 1.2fr);
    }

    .domain-list-head {
        display: grid;
        padding: 10px 9px;
        font-size: .58rem;
        letter-spacing: .06em;
    }

    .domain-row {
        display: grid;
        min-height: 67px;
        padding: 10px 9px;
        border: 0;
        border-top: 1px solid var(--line);
        border-radius: 0;
        background: var(--white);
        box-shadow: none;
    }

    .domain-row + .domain-row {
        margin-top: 0;
    }

    .domain-number {
        display: inline-block;
        margin: 0;
        font-size: .66rem;
    }

    .domain-name {
        gap: 4px;
        padding-right: 7px;
        font-size: .78rem;
        line-height: 1.3;
    }

    .domain-name svg {
        width: 12px;
    }

    .mobile-label {
        display: none;
    }

    .domain-note {
        margin: 0;
        padding: 0 0 0 9px;
        border-top: 0;
        border-left: 1px solid var(--line);
    }

    .domain-note p {
        font-size: .75rem;
        line-height: 1.42;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .admin-main {
        padding: 38px 0 60px;
    }

    .admin-intro {
        align-items: stretch;
        flex-direction: column;
        margin-bottom: 28px;
    }

    .admin-count {
        min-width: 0;
    }

    .admin-content {
        width: 100%;
        padding: 22px 14px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .admin-domain-card {
        padding: 17px;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .form-actions .button {
        width: 100%;
    }

    .auth-panel {
        padding: 30px 20px;
    }

    .auth-message-panel {
        gap: 48px;
    }

    .auth-message-panel h1 {
        font-size: clamp(2.2rem, 12vw, 3.7rem);
    }

    .auth-form-panel {
        min-height: auto;
        padding-block: 42px;
    }

    .auth-card {
        padding: 25px 20px;
        border-radius: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
