@import url("./app.css");

[hidden] {
    display: none !important;
}

.profile-list,
.account-list {
    display: grid;
    gap: 20px;
}

.profile-card,
.account-card {
    padding: 22px;
    border: 1px solid rgba(74, 61, 44, 0.14);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.66);
    box-shadow: 0 14px 34px rgba(42, 46, 57, 0.08);
    animation: rise-in 0.35s ease;
}

.panel-details {
    margin-top: 16px;
}

.panel.is-collapsed .panel-details {
    display: none;
}

.auth-box[hidden] {
    display: none;
}

.auth-box {
    display: grid;
    gap: 8px;
}

.page-busy-overlay[hidden] {
    display: none;
}

.page-busy-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(245, 239, 228, 0.62);
    backdrop-filter: blur(6px);
}

.page-busy-dialog {
    min-width: 260px;
    max-width: 420px;
    padding: 24px 28px;
    border-radius: 24px;
    border: 1px solid rgba(74, 61, 44, 0.12);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 20px 48px rgba(42, 46, 57, 0.16);
    text-align: center;
}

.page-busy-spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto 14px;
    border-radius: 50%;
    border: 4px solid rgba(31, 107, 92, 0.14);
    border-top-color: var(--accent-strong);
    animation: spin 0.9s linear infinite;
}

.page-busy-text {
    margin: 0;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
}

.top-notice {
    margin: 18px 0 0;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(74, 61, 44, 0.14);
    background: rgba(255, 248, 225, 0.92);
    color: var(--text-main);
    font-weight: 600;
    line-height: 1.5;
}

.top-notice.is-info {
    background: rgba(255, 248, 225, 0.92);
    border-color: rgba(181, 135, 42, 0.2);
}

.top-notice.is-success {
    background: rgba(235, 248, 241, 0.95);
    border-color: rgba(31, 107, 92, 0.22);
    color: var(--accent-strong);
}

.top-notice.is-error {
    background: rgba(255, 241, 240, 0.95);
    border-color: rgba(166, 61, 64, 0.22);
    color: var(--danger);
}

.toast-stack {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: grid;
    gap: 12px;
    width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(74, 61, 44, 0.14);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 36px rgba(42, 46, 57, 0.16);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 14px;
    font-weight: 700;
    animation: toast-in 0.22s ease;
}

.toast.is-success {
    border-color: rgba(31, 107, 92, 0.22);
    background: rgba(235, 248, 241, 0.98);
    color: var(--accent-strong);
}

.toast.is-error {
    border-color: rgba(166, 61, 64, 0.22);
    background: rgba(255, 241, 240, 0.98);
    color: var(--danger);
}

.toast.is-info {
    border-color: rgba(181, 135, 42, 0.2);
    background: rgba(255, 248, 225, 0.98);
}

.inline-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

button.is-busy {
    opacity: 0.78;
    cursor: wait;
}

button[disabled] {
    cursor: not-allowed;
}

.inline-actions select {
    flex: 1 1 220px;
}

.inline-tip {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.5;
}

.profile-card-header,
.account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.profile-card-copy {
    margin: 6px 0 0;
    color: var(--text-soft);
    line-height: 1.5;
    font-size: 13px;
}

.profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.profile-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex: 1;
}

.account-row {
    margin-bottom: 0;
}

.account-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex: 1;
}

.summary-main,
.summary-side,
.account-row-actions,
.account-title {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.summary-main strong {
    font-size: 18px;
}

.summary-meta {
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 600;
}

.status-pill {
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(31, 107, 92, 0.12);
    color: var(--accent-strong);
    font-size: 13px;
    font-weight: 700;
}

.status-pill.is-disabled {
    background: rgba(166, 61, 64, 0.12);
    color: var(--danger);
}

.account-details {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed rgba(74, 61, 44, 0.18);
}

.profile-details {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed rgba(74, 61, 44, 0.18);
}

.profile-card.is-collapsed .profile-details,
.account-card.is-collapsed .account-details {
    display: none;
}

.toggle-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(31, 107, 92, 0.1);
    color: var(--accent-strong);
    font-size: 14px;
    font-weight: 700;
}

.toggle-inline input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.template-block {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed rgba(74, 61, 44, 0.18);
}

.profile-card {
    padding: 18px 20px;
    border-radius: 20px;
}

.profile-card .section-title {
    margin-bottom: 12px;
}

.profile-card .template-block {
    margin-top: 14px;
    padding-top: 14px;
}

.profile-card .template-list {
    gap: 12px;
}

.profile-card .template-card {
    padding: 14px;
    border-radius: 16px;
}

.profile-card .template-card-header {
    margin-bottom: 10px;
}

.profile-card .field input,
.profile-card .field select {
    min-height: 42px;
    padding: 10px 12px;
}

.template-card.is-dynamic [data-field="description"] {
    border-style: dashed;
    background: rgba(31, 107, 92, 0.05);
}

.field select {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid rgba(74, 61, 44, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-main);
    font: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.field select:focus {
    outline: none;
    border-color: rgba(31, 107, 92, 0.65);
    box-shadow: 0 0 0 4px rgba(31, 107, 92, 0.12);
    transform: translateY(-1px);
}

@media (max-width: 900px) {
    .profile-card-header,
    .profile-row,
    .profile-summary,
    .account-row,
    .account-summary,
    .summary-side,
    .account-row-actions,
    .account-title {
        flex-direction: column;
        align-items: flex-start;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
