* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: #eef4ff;
    color: #1d3557;
    font-family: "OPPO Sans", "Helvetica Neue", "Microsoft YaHei", Helvetica, Arial, sans-serif;
}

a {
    color: #2f6fe4;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(180deg, #3b7ef2, #2f6fe4);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(47, 111, 228, 0.28);
}

.button-link.secondary {
    background: #ffffff;
    color: #2f6fe4;
    border: 1px solid #c9d8ee;
    box-shadow: none;
}

.button-link:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Landing */

.landing {
    background:
        radial-gradient(circle at 15% 10%, rgba(59, 126, 242, 0.18), transparent 42%),
        radial-gradient(circle at 85% 0%, rgba(96, 165, 250, 0.16), transparent 40%),
        #eef4ff;
}

.landing-header {
    display: flex;
    align-items: center;
    height: 68px;
    padding: 0 32px;
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(15, 61, 145, 0.08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(180deg, #3b7ef2, #2f6fe4);
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 800;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1d3557;
}

.landing-main {
    max-width: 1040px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

.landing-hero {
    max-width: 720px;
}

.landing-hero h1 {
    margin: 0 0 16px;
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -0.02em;
}

.landing-hero p {
    margin: 0 0 28px;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #3d5a80;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.landing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 56px;
}

.landing-card {
    padding: 22px;
    border: 1px solid #dbe7fb;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 26px rgba(15, 61, 145, 0.06);
}

.landing-card h2 {
    margin: 0 0 10px;
    font-size: 1.02rem;
}

.landing-card p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #4a6785;
}

/* Simple pages */

.simple-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.simple-card {
    width: 100%;
    max-width: 460px;
    padding: 30px 28px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 18px 50px rgba(9, 30, 66, 0.16);
}

.simple-card h1 {
    margin: 0 0 12px;
    font-size: 1.35rem;
}

.simple-card p {
    margin: 0 0 16px;
    font-size: 0.92rem;
    line-height: 1.7;
    color: #4a6785;
}

.success-badge {
    display: inline-block;
    margin-bottom: 12px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #e6f7ee;
    color: #1b8a5a;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Forms */

.form-title {
    margin: 0 0 6px;
    font-size: 1.4rem;
}

.form-subtitle {
    margin: 0 0 22px;
    font-size: 0.88rem;
    line-height: 1.6;
    color: #6b86a8;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 0.84rem;
    color: #3d5a80;
}

.field span {
    font-weight: 600;
}

.field input,
.field select {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #c9d8ee;
    border-radius: 9px;
    background: #f7faff;
    color: #1d3557;
    font-size: 0.92rem;
    outline: none;
}

.field input:focus,
.field select:focus {
    border-color: #2f6fe4;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(47, 111, 228, 0.15);
}

.captcha-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.captcha-row .field {
    flex: 1;
    margin-bottom: 0;
}

.captcha-image {
    flex: 0 0 150px;
    height: 48px;
    padding: 0;
    border: 1px solid #c9d8ee;
    border-radius: 9px;
    background: #f7faff;
    cursor: pointer;
    overflow: hidden;
}

.captcha-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hint {
    margin: 0 0 16px;
    font-size: 0.78rem;
    line-height: 1.6;
    color: #6b86a8;
}

.message {
    margin: 0 0 14px;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 0.84rem;
    line-height: 1.6;
}

.message.error {
    background: #fff1f0;
    color: #c0392b;
}

.message.ok {
    background: #e6f7ee;
    color: #1b8a5a;
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.form-footer {
    margin-top: 18px;
    font-size: 0.8rem;
    color: #6b86a8;
    line-height: 1.7;
}

/* Admin */

.admin-page {
    background: #eef4ff;
}

.admin-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    margin-bottom: 20px;
    border-radius: 14px;
    background: linear-gradient(180deg, #3b7ef2, #2f6fe4);
    color: #ffffff;
    box-shadow: 0 10px 28px rgba(30, 82, 180, 0.22);
}

.admin-header h1 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.admin-header .who {
    font-size: 0.82rem;
    opacity: 0.9;
}

.admin-header .button-link {
    height: 34px;
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: none;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.card {
    padding: 16px 18px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(15, 61, 145, 0.06);
}

.card .label {
    font-size: 0.76rem;
    color: #6b86a8;
}

.card .value {
    margin-top: 6px;
    font-size: 1.5rem;
    font-weight: 800;
    color: #1d3557;
}

.panel {
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(15, 61, 145, 0.06);
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.panel-head h2 {
    margin: 0;
    font-size: 1rem;
}

.panel-head .tools {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.input {
    height: 36px;
    padding: 0 12px;
    border: 1px solid #c9d8ee;
    border-radius: 8px;
    background: #f7faff;
    color: #1d3557;
    font-size: 0.86rem;
    outline: none;
}

.input:focus {
    border-color: #2f6fe4;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(47, 111, 228, 0.15);
}

.button-small {
    height: 32px;
    padding: 0 12px;
    border: 1px solid #c9d8ee;
    border-radius: 8px;
    background: #ffffff;
    color: #2f6fe4;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.button-small.primary {
    border-color: #2f6fe4;
    background: #2f6fe4;
    color: #ffffff;
}

.button-small.danger {
    border-color: #f3c4c0;
    background: #fff6f5;
    color: #c0392b;
}

.button-small:disabled {
    opacity: 0.5;
    cursor: default;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

th,
td {
    padding: 10px 8px;
    border-bottom: 1px solid #eef2f9;
    text-align: left;
    white-space: nowrap;
}

th {
    color: #6b86a8;
    font-weight: 600;
    font-size: 0.76rem;
}

td.actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.badge.ok {
    background: #e6f7ee;
    color: #1b8a5a;
}

.badge.warn {
    background: #fff4e5;
    color: #b45309;
}

.badge.off {
    background: #f1f3f7;
    color: #6b7280;
}

.empty {
    padding: 18px;
    text-align: center;
    color: #8aa2c0;
    font-size: 0.84rem;
}

.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px;
}

.smtp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.smtp-grid .field {
    margin-bottom: 0;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(12, 34, 68, 0.45);
}

.modal-panel {
    width: 520px;
    max-width: 100%;
    max-height: 80vh;
    overflow: auto;
    padding: 24px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 24px 64px rgba(9, 30, 66, 0.35);
}

.modal-panel h2 {
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.modal-panel pre {
    margin: 0 0 16px;
    padding: 12px;
    border-radius: 9px;
    background: #f5f9ff;
    font-size: 0.82rem;
    white-space: pre-wrap;
    word-break: break-all;
}

@media (max-width: 640px) {
    .landing-header,
    .admin-shell {
        padding-left: 16px;
        padding-right: 16px;
    }
    .captcha-row {
        flex-direction: column;
        align-items: stretch;
    }
    .captcha-image {
        flex-basis: 48px;
    }
}

[hidden] {
    display: none !important;
}
