/* Domains (Components/Pages/Domains/Domains.razor): the domains connected to the account's websites and those
   registered through Webbuilder as cards, and the dialogs for a domain's connection settings and DNS. Follows the
   website builder's domain page (WebbuilderWeb css/Pages/Domains.css). The page frame and head are the shared app page
   ones (WebbuilderUI css/app-page.css). Skeleton: Components/Skeletons/Domains/DomainsSkeleton.razor. */

/* ============
     sections
   ============ */

.dom-section {
    margin-bottom: 36px;
}

/* The page padding is the only space under the last section */
.dom-section:last-child {
    margin-bottom: 0;
}

.dom-section-head {
    margin-bottom: 16px;
}

.dom-section-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 20px;
}

.dom-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--app-text-strong);
}

.dom-section-title .bx {
    font-size: 20px;
    color: var(--app-accent);
}

.dom-section-lead {
    margin: 4px 0 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--app-text-muted);
}

.dom-quiet {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 16px 18px;
    border: 1px dashed var(--app-line);
    border-radius: 16px;
    font-size: 14px;
    color: var(--app-text-muted);
}

.dom-quiet .bx {
    font-size: 18px;
    color: var(--app-accent);
}

/* Messages: info, a success and a warning */
.dom-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--app-text);
}

.dom-banner .bx {
    flex: none;
    margin-top: 2px;
    font-size: 18px;
}

.dom-banner strong {
    font-weight: 600;
    color: var(--app-text-strong);
}

.dom-banner-ok {
    background: var(--app-success-soft);
}

.dom-banner-ok .bx {
    color: var(--app-success);
}

.dom-banner-warn {
    background: var(--app-warning-soft);
}

.dom-banner-warn .bx {
    color: var(--app-warning);
}

.dom-banner-info {
    background: var(--app-bg-soft);
}

.dom-banner-info .bx {
    color: var(--app-accent);
}

/* =========
     cards
   ========= */

.dom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dom-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border: 1px solid var(--app-line);
    border-radius: 20px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow-soft);
    animation-delay: calc(var(--dom-i, 0) * 50ms + 80ms);
    transition: border-color 0.25s ease, box-shadow 0.3s ease, transform 0.35s var(--app-ease-spring);
}

@media (hover: hover) {
    .dom-card:not(.dom-card-skel):hover {
        box-shadow: var(--app-shadow-hover);
        transform: translateY(-2px);
    }
}

.dom-card-ok {
    border-color: color-mix(in srgb, var(--app-success) 35%, var(--app-line));
}

.dom-card-warn {
    border-color: color-mix(in srgb, var(--app-warning) 45%, var(--app-line));
}

.dom-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.dom-card-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.dom-card-name h3 {
    margin: 0;
    font-size: 16.5px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--app-text-strong);
    overflow-wrap: anywhere;
}

.dom-card-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--app-accent-soft);
    font-size: 20px;
    color: var(--app-accent);
}

.dom-card-actions {
    display: flex;
    flex: none;
    gap: 4px;
}

.dom-act {
    width: 36px;
    height: 36px;
    font-size: 18px;
}

.dom-card-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.dom-card-badges .app-badge {
    gap: 4px;
}

/* Status with a dot that pulses while waiting */
.dom-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.dom-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.dom-status-ok {
    background: var(--app-success-soft);
    color: var(--app-success);
}

.dom-status-pending {
    background: var(--app-accent-soft);
    color: var(--app-accent);
}

.dom-status-pending .dom-status-dot {
    animation: dom-pulse 1.6s ease-in-out infinite;
}

.dom-status-warn {
    background: var(--app-warning-soft);
    color: var(--app-warning);
}

.dom-note {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--app-text-muted);
}

.dom-note-ok {
    color: var(--app-success);
}

.dom-note-warn {
    color: var(--app-warning);
}

.dom-note-pending {
    color: var(--app-accent);
}

/* Waiting for the DNS: the deadline and Check now */
.dom-verify {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--app-bg-soft);
}

.dom-verify-text {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--app-text);
}

.dom-verify-text .bx {
    flex: none;
    margin-top: 2px;
    color: var(--app-accent);
}

.dom-verify-deadline {
    margin: 0;
    font-size: 12px;
    color: var(--app-warning);
}

.dom-check-again {
    align-self: flex-start;
}

.dom-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: auto 0 0;
    font-size: 12px;
    color: var(--app-text-muted);
}

/* The added date with Manage, at the foot of a connected domain's card */
.dom-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-top: auto;
}

.dom-card-foot .dom-card-meta {
    margin: 0;
}

.dom-card-foot .app-btn {
    text-decoration: none;
}

.dom-card-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dom-card-buttons .app-btn {
    text-decoration: none;
}

.dom-card-skel {
    box-shadow: none;
}

/* The section title and lead of the skeleton, spaced like the real ones */
.dom-skel-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Nothing connected yet */
.dom-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 24px;
    border: 1px dashed var(--app-line);
    border-radius: 24px;
    background: var(--app-surface);
    text-align: center;
}

.dom-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--app-accent-soft);
    font-size: 30px;
    color: var(--app-accent);
}

.dom-empty-title {
    margin: 16px 0 0;
    font-size: 19px;
    font-weight: 600;
    color: var(--app-text-strong);
}

.dom-empty-text {
    max-width: 420px;
    margin: 6px 0 20px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--app-text-muted);
}

/* The website a connected or registered domain belongs to */
.dom-card-site {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -4px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--app-text-muted);
    overflow-wrap: anywhere;
}

.dom-card-site .bx {
    flex: none;
    font-size: 16px;
    color: var(--app-accent);
}

/* The control panel username in the DNS dialog, with its copy button */
.dom-copy {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 8px 16px;
    border: 1px solid var(--app-field-line);
    border-radius: 14px;
    background: var(--app-field-bg);
}

.dom-copy code {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    color: var(--app-text-strong);
    overflow-wrap: anywhere;
}


/* ===========
     dialogs
   =========== */

.dom-dialog {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.dom-dialog-scrim {
    position: absolute;
    inset: 0;
    background: var(--app-scrim);
    animation: dom-fade 0.25s ease both;
}

.dom-dialog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(460px, 100%);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    border: 1px solid var(--app-line);
    border-radius: 24px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow-menu);
    animation: dom-pop 0.4s var(--app-ease-spring) both;
}

.dom-dialog-card-wide {
    width: min(620px, 100%);
}

.dom-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 14px 22px;
    border-bottom: 1px solid var(--app-line);
}

.dom-dialog-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--app-text-strong);
    overflow-wrap: anywhere;
}

.dom-dialog-title .bx {
    flex: none;
    font-size: 20px;
    color: var(--app-accent);
}

.dom-dialog-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px 22px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.dom-dialog-body .dom-banner {
    margin: 0;
}

.dom-dialog-lead {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--app-text-muted);
}

/* The setup instructions while they are read from the server */
.dom-dialog-skel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dom-dialog-wide {
    width: 100%;
    text-decoration: none;
}

.dom-dialog-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px 20px;
    border-top: 1px solid var(--app-line);
}

/* A request that changes a domain is running */
.dom-working {
    position: fixed;
    inset: 0;
    z-index: 1070;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--app-scrim);
    animation: dom-fade 0.2s ease both;
}

.dom-working-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 28px 32px;
    border-radius: 22px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow-menu);
    text-align: center;
    animation: dom-pop 0.35s var(--app-ease-spring) both;
}

.dom-working-card p {
    margin: 0;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--app-text-strong);
}

.dom-working-spinner {
    width: 36px;
    height: 36px;
    border-width: 3px;
}

/* ===========
     dialogs
   =========== */

/* ==============
     animation
   ============== */

@keyframes dom-pulse {
    50% {
        opacity: 0.35;
    }
}

@keyframes dom-fade {
    from {
        opacity: 0;
    }
}

@keyframes dom-pop {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
}

/* ==============
     animation
   ============== */


/* ==============
     responsive
   ============== */

@media (max-width: 767.98px) {
    .dom-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dom-card {
        padding: 18px;
    }

    .dom-dialog {
        align-items: flex-end;
        padding: 0;
    }

    .dom-dialog-card,
    .dom-dialog-card-wide {
        width: 100%;
        max-height: 90vh;
        max-height: 90dvh;
        border-radius: 24px 24px 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dom-dialog-scrim,
    .dom-dialog-card,
    .dom-working,
    .dom-working-card,
    .dom-status-pending .dom-status-dot {
        animation: none;
    }

    .dom-card {
        transition: none;
    }
}
