/* ══════════════════════════════════════════════════════════════════════════
   SCA Frontend Styles  v2.1
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Standalone result page (rewrite endpoint, no theme wrapper) ──────────── */
.sca-standalone-body {
    margin: 0;
    padding: 0;
    background: #f4f6f9;
    min-height: 100vh;
}
.sca-standalone-body .sca-result-wrap { max-width: 100%; }
.sca-standalone-body .sca-result-inner { max-width: 820px; margin: 0 auto; }

/* ── Widget: Dark Theme ─────────────────────────────────────────────────── */
.sca-widget--dark {
    background: #1a1e2e;
    padding: 20px 18px 22px;
    border-radius: 4px;
    font-family: Arial, Helvetica, sans-serif;
}
.sca-widget--dark .sca-widget__title {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 8px;
}
.sca-widget--dark .sca-widget__subtitle {
    color: #a0aabf;
    font-size: 12.5px;
    line-height: 1.5;
    margin: 0 0 14px;
}
.sca-widget--dark .sca-widget__error {
    background: rgba(192,57,43,0.18);
    color: #ff7b7b;
    font-size: 12px;
    padding: 7px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}
.sca-widget--dark .sca-widget__input {
    width: 100%;
    background: #2a2f45;
    border: 1px solid #3d4460;
    border-radius: 4px;
    padding: 10px 12px;
    color: #c8d0e7;
    font-size: 13.5px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}
.sca-widget--dark .sca-widget__input:focus { border-color: #5a7fc5; }
.sca-widget--dark .sca-widget__input::placeholder { color: #6c7a9a; }

/* Captcha row */
.sca-widget--dark .sca-widget__captcha-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}
.sca-captcha-img-wrap { flex: 0 0 auto; }
.sca-captcha-img {
    display: block;
    height: 45px;
    width: 130px;
    border-radius: 4px;
    border: 1px solid #3d4460;
    cursor: pointer;
    background: #f4f4f7;
}
.sca-captcha-input-wrap { flex: 1; }

.sca-widget--dark .sca-widget__submit-row {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
}
.sca-widget--dark .sca-widget__btn {
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 9px 28px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.sca-widget--dark .sca-widget__btn:hover { background: #a93226; }

/* ── Widget: Light Theme ────────────────────────────────────────────────── */
.sca-widget--light {
    background: #ffffff;
    padding: 14px 12px 18px;
    font-family: Arial, Helvetica, sans-serif;
}
.sca-widget--light .sca-widget__title {
    font-size: 14px;
    color: #1a1a2e;
    font-weight: 700;
    margin: 0 0 10px;
}
.sca-widget--light .sca-widget__error {
    color: #c0392b;
    font-size: 12px;
    margin-bottom: 8px;
}
.sca-widget--light .sca-widget__input {
    width: 100%;
    background: #f0f2f5;
    border: 1px solid #d5d9e0;
    border-radius: 4px;
    padding: 10px 12px;
    color: #333;
    font-size: 13.5px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}
.sca-widget--light .sca-widget__input:focus { border-color: #5a7fc5; }
.sca-widget--light .sca-widget__input::placeholder { color: #9aa0ad; }

.sca-widget--light .sca-widget__field { margin-bottom: 10px; }

.sca-widget--light .sca-widget__captcha-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 2px;
}
.sca-widget--light .sca-captcha-img {
    display: block;
    height: 45px;
    width: 130px;
    border-radius: 4px;
    border: 1px solid #d5d9e0;
    cursor: pointer;
    background: #f4f4f7;
}
.sca-widget--light .sca-captcha-input-wrap { flex: 1; }

.sca-widget--light .sca-widget__submit-row {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}
.sca-widget--light .sca-widget__btn {
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 9px 28px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.sca-widget--light .sca-widget__btn:hover { background: #a93226; }

/* ── Result Page ────────────────────────────────────────────────────────── */
.sca-result-wrap {
    max-width: 100%;
    font-family: Arial, Helvetica, sans-serif;
}

.sca-result-inner {
    padding: 28px 24px 32px;
}

.sca-result-table-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: 0.5px;
    text-align: center;
    margin: 0 0 18px;
}

/* Main certificate table — matches screenshot exactly */
.sca-result-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #d0d5dd;
    background: #fff;
    margin-bottom: 24px;
}
.sca-result-table th,
.sca-result-table td {
    padding: 11px 16px;
    border-bottom: 1px solid #e0e4ec;
    border-right: 1px solid #e0e4ec;
    vertical-align: top;
    text-align: left;
    font-size: 13.5px;
}
.sca-result-table th {
    width: 36%;
    color: #1a1a2e;
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 0.3px;
    background: #ffffff;
}
.sca-result-table td {
    color: #333;
    font-weight: 400;
    background: #ffffff;
}
.sca-result-table tr:last-child th,
.sca-result-table tr:last-child td { border-bottom: none; }
.sca-result-table td { border-right: none; }

/* Save button — matches screenshot (blue) */
.sca-result-actions {
    display: flex;
    justify-content: center;
    margin-top: 4px;
}
.sca-btn-save {
    background: #2980b9;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 9px 32px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    min-width: 90px;
}
.sca-btn-save:hover { background: #1a6fa0; }

/* Not Found */
.sca-result-not-found {
    text-align: center;
    padding: 60px 40px;
    background: #fff;
    border: 1px solid #e0e4ec;
    border-radius: 6px;
}
.sca-nf-icon { font-size: 42px; margin-bottom: 12px; }
.sca-result-not-found h2 { color: #c0392b; margin-bottom: 10px; }
.sca-result-not-found p  { color: #555; margin-bottom: 20px; }

/* Shared button styles */
.sca-btn {
    display: inline-block;
    padding: 9px 22px;
    border-radius: 5px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
}
.sca-btn-primary  { background:#003366; color:#fff !important; }
.sca-btn-primary:hover { background:#004d99; }
.sca-btn-secondary{ background:#f0f2f5; color:#333 !important; border:1px solid #d0d5dd; }
.sca-btn-secondary:hover { background:#e0e4ec; }

/* Notice */
.sca-notice { padding:11px 15px; border-radius:5px; margin-bottom:14px; font-size:13.5px; }
.sca-notice-success { background:#e8f5e9; color:#2e7d32; border-left:4px solid #2e7d32; }
.sca-notice-error   { background:#fdecea; color:#c0392b; border-left:4px solid #c0392b; }

/* Login required prompt */
.sca-login-required {
    max-width: 480px;
    margin: 30px auto;
    text-align: center;
    background: #fff;
    border: 1px solid #e0e4ec;
    border-radius: 8px;
    padding: 40px 32px;
}
.sca-login-required__icon { font-size: 38px; margin-bottom: 10px; }
.sca-login-required h3 { color:#003366; font-size:18px; margin-bottom:10px; }
.sca-login-required p { color:#555; font-size:13.5px; line-height:1.6; margin-bottom:20px; }

/* Frontend add form */
.sca-add-form-wrap { max-width:860px; margin:20px auto; }
.sca-form-header { background:#003366; padding:13px 20px; border-radius:4px 4px 0 0; }
.sca-form-header h2 { color:#fff; font-size:14px; letter-spacing:1px; margin:0; }
.sca-cert-table { width:100%; border-collapse:collapse; background:#fff; border:1px solid #d0d5dd; }
.sca-cert-table th,.sca-cert-table td { padding:9px 15px; border-bottom:1px solid #e0e4ec; vertical-align:middle; }
.sca-cert-table th { background:#eef2f7; font-size:12px; font-weight:700; letter-spacing:0.5px; color:#003366; width:36%; }
.sca-cert-table input[type="text"],.sca-cert-table textarea { width:100%; padding:7px 11px; border:1px solid #d0d5dd; border-radius:4px; font-size:13px; font-family:inherit; box-sizing:border-box; }
.sca-cert-table textarea { resize:vertical; }
.sca-form-actions { margin-top:18px; }
.sca-required { color:#c0392b; }

/* Spinner overlay */
.sca-spinner-wrap { display:none; position:fixed; inset:0; background:rgba(255,255,255,0.8); z-index:99999; justify-content:center; align-items:center; }
.sca-spinner-wrap.active { display:flex; }
.sca-spinner { width:42px; height:42px; border:5px solid #ddd; border-top-color:#003366; border-radius:50%; animation:sca-spin 0.75s linear infinite; }
@keyframes sca-spin { to { transform:rotate(360deg); } }

@media (max-width: 600px) {
    .sca-result-inner { padding: 18px 12px 22px; }
    .sca-result-table th { width:44%; font-size:11px; }
    .sca-widget--dark, .sca-widget--light { padding: 14px 12px 16px; }
}
