* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #1f2937;
    background:
        radial-gradient(circle at top left, rgba(96, 165, 250, 0.22), transparent 32%),
        linear-gradient(135deg, #f8fafc 0%, #eef4ff 100%);
}

.page {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    padding: 40px 16px;
}

.card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 22px;
    padding: 34px;
    box-shadow: 0 18px 45px rgba(30, 64, 175, 0.12);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

h1 {
    margin: 0 0 14px;
    font-size: 30px;
    line-height: 1.35;
    color: #111827;
}

h2 {
    margin: 0 0 10px;
    font-size: 22px;
}

.lead {
    margin: 0 0 28px;
    line-height: 1.9;
    color: #4b5563;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #111827;
}

.required,
.optional {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    vertical-align: middle;
}

.required {
    color: #b91c1c;
    background: #fee2e2;
}

.optional {
    color: #475569;
    background: #e2e8f0;
}

input,
select,
textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 16px;
    background: #ffffff;
    color: #111827;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.help-text {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 13px;
}

.privacy-box {
    margin-top: 24px;
    padding: 18px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.privacy-box p {
    margin: 0;
    line-height: 1.8;
    color: #475569;
    font-size: 14px;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    line-height: 1.7;
    cursor: pointer;
}

.check-row input {
    width: auto;
    margin-top: 5px;
    flex-shrink: 0;
}

.error-box {
    margin-bottom: 22px;
    padding: 16px 18px;
    border-radius: 14px;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}

.error-box ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.success-box {
    padding: 22px;
    border-radius: 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    line-height: 1.8;
}

.success-box p {
    margin: 0;
}

.submit-button {
    width: 100%;
    margin-top: 22px;
    padding: 15px 20px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.submit-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.34);
}

.submit-button:active {
    transform: translateY(0);
    opacity: 0.9;
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .page {
        padding: 24px 12px;
    }

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

    h1 {
        font-size: 24px;
    }

    .lead {
        font-size: 15px;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }
}

.admin-page {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 16px;
}

.admin-card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 22px;
    padding: 30px;
    box-shadow: 0 18px 45px rgba(30, 64, 175, 0.12);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.logout-link {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

.logout-link:hover {
    text-decoration: underline;
}

.login-form {
    max-width: 420px;
}

.mail-panel {
    margin-bottom: 34px;
    padding: 22px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.mail-panel h2,
.table-header h2 {
    margin: 0 0 16px;
    font-size: 21px;
}

.mail-body {
    min-height: 260px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.danger-button {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.24);
}

.table-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.table-header h2 {
    margin-right: auto;
}

.small-button {
    width: auto;
    margin: 0;
    padding: 8px 13px;
    border: none;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.muted-button {
    background: #64748b;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1040px;
    background: #fff;
}

.admin-table th,
.admin-table td {
    padding: 11px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    font-size: 14px;
    vertical-align: middle;
}

.admin-table th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 800;
    white-space: nowrap;
}

.admin-table tr:hover td {
    background: #f8fafc;
}

.admin-table input[type="checkbox"] {
    width: auto;
}

.empty-cell {
    text-align: center;
    color: #64748b;
    padding: 28px !important;
}

.status-badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #e2e8f0;
    color: #334155;
}

.status-applied {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-contacted {
    background: #dcfce7;
    color: #166534;
}

.status-approved {
    background: #fef3c7;
    color: #92400e;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 640px) {
    .admin-card {
        padding: 22px 16px;
    }

    .admin-header {
        flex-direction: column;
    }

    .mail-panel {
        padding: 18px;
    }

    .table-header {
        flex-wrap: wrap;
    }

    .table-header h2 {
        width: 100%;
    }
}

.form-section {
    margin: 28px 0 24px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.form-section h2 {
    margin: 0 0 8px;
    font-size: 21px;
    color: #111827;
}

.section-help {
    margin: 0 0 18px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.8;
}

.policy-links {
    margin-top: 10px !important;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
}

.policy-links a {
    color: #2563eb;
    text-decoration: none;
}

.policy-links a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .checkbox-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.mail-help {
    margin-top: 10px;
    padding: 12px 14px;
    background: #f7f9fc;
    border: 1px solid #dfe5ec;
    border-radius: 8px;
    color: #555;
    font-size: 14px;
    line-height: 1.7;
}

.mail-help p {
    margin: 0 0 6px;
}

.mail-help p:last-child {
    margin-bottom: 0;
}

.mail-help strong {
    color: #333;
    word-break: break-all;
}
