/* 
 * SmallPict Admin CSS — Onboarding + Connected State
 */

/* ── App Container ── */
#smallpict-app {
    max-width: 520px;
    margin: 40px auto;
    background: #fff;
    padding: 40px 36px;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    border-radius: 6px;
}

@media (max-width: 600px) {
    #smallpict-app {
        margin: 20px 12px;
        padding: 28px 20px;
        max-width: 100%;
    }
}

/* ── Typography ── */
#smallpict-app h1 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    color: #1d2327;
}

.sp-subtitle {
    text-align: center;
    color: #646970;
    margin: 0 0 28px;
    font-size: 14px;
    line-height: 1.55;
}

.sp-subtitle strong {
    color: #1d2327;
    font-weight: 600;
}

/* ── OTP Header Block ── */
.sp-otp-header {
    margin-bottom: 24px;
}

/* ── Form Groups ── */
.sp-form-group {
    margin-bottom: 20px;
}

.sp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #1d2327;
}

.sp-form-group input[type="email"],
.sp-form-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;
    border-radius: 4px;
    border: 1px solid #8c8f94;
    background: #fff;
    color: #1d2327;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.sp-form-group input[type="email"]:focus,
.sp-form-group input[type="text"]:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

/* ── OTP Input ── */
.sp-otp-input-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.sp-otp-input {
    width: 100%;
    max-width: 280px;
    text-align: center;
    letter-spacing: 12px;
    font-size: 28px !important;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 14px 16px !important;
    border-radius: 6px;
    border: 2px solid #c3c4c7;
    background: #fff;
    color: #1d2327;
    caret-color: #2271b1;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.sp-otp-input:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(34,113,177,.15);
}

.sp-otp-input:disabled {
    background: #f6f7f7;
    border-color: #dcdcde;
    color: #a7aaad;
    cursor: not-allowed;
}

.sp-otp-input.sp-error-shake {
    animation: sp-shake 0.45s ease-in-out;
    border-color: #d63638 !important;
}

@keyframes sp-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ── Buttons ── */
.sp-button-block {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px !important;
    font-size: 15px !important;
    font-weight: 500;
    border-radius: 4px;
}

/* ── Consent Box ── */
.sp-consent-box {
    background: #f6f7f7;
    padding: 16px;
    border-left: 4px solid #2271b1;
    border-radius: 0 4px 4px 0;
    margin-bottom: 24px;
    font-size: 13px;
    line-height: 1.5;
    color: #3c434a;
}

.sp-consent-box input[type="checkbox"] {
    margin-right: 6px;
    vertical-align: middle;
}

.sp-consent-box a {
    color: #2271b1;
    text-decoration: underline;
}

.sp-consent-box a:hover {
    color: #135e96;
}

/* ── Countdown ── */
.sp-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #646970;
}

.sp-countdown-label {
    font-weight: 400;
}

.sp-countdown-timer {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #d63638;
    background: #fcf0f1;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.sp-countdown-timer-inline {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #646970;
    margin-left: 2px;
}

/* ── Notices (inline, modern) ── */
.sp-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 6px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
}

.sp-notice__icon {
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1.3;
    margin-top: -1px;
}

.sp-notice__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sp-notice__body strong {
    font-weight: 600;
    color: #1d2327;
}

.sp-notice__body span {
    color: #3c434a;
}

.sp-notice--warning {
    background: #fcf9e8;
    border-color: #f0e6b6;
    color: #755100;
}

.sp-notice--warning .sp-notice__icon {
    color: #bfa230;
}

.sp-notice--error {
    background: #fcf0f1;
    border-color: #f0c4c5;
    color: #8a2424;
}

.sp-notice--error .sp-notice__icon {
    color: #d63638;
}

.sp-notice--success {
    background: #edfaef;
    border-color: #c0edc7;
    color: #1e4620;
}

.sp-notice--success .sp-notice__icon {
    color: #00a32a;
}

/* ── Secondary Action Row ── */
.sp-action-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 28px;
    flex-wrap: wrap;
}

.sp-action-row__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1.4;
    color: #2271b1;
    text-decoration: none;
    background: none;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 3px;
    transition: color .15s ease, background .15s ease;
    min-height: 32px;
}

.sp-action-row__item:hover:not(:disabled) {
    color: #135e96;
    background: rgba(34,113,177,.06);
    text-decoration: underline;
}

.sp-action-row__item:focus {
    outline: 1px solid #2271b1;
    outline-offset: 1px;
}

.sp-action-row__item:disabled,
.sp-action-row__item[disabled] {
    color: #a7aaad;
    cursor: not-allowed;
    background: none;
    text-decoration: none;
}

.sp-action-row__divider {
    display: inline-block;
    width: 4px;
    height: 4px;
    background: #c3c4c7;
    border-radius: 50%;
    margin: 0 4px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .sp-action-row {
        gap: 4px;
    }
    .sp-action-row__divider {
        display: none;
    }
    .sp-action-row__item {
        width: 100%;
        padding: 8px;
    }
}

/* ── Legacy sp-links (keep for backward compat) ── */
.sp-links {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
}

/* ── Cards ── */
.sp-card {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.sp-progress-bar {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.sp-progress-fill {
    height: 10px;
    background-color: #2271b1;
}

/* ── Connected State Panel ── */
.sp-connected-panel {
    margin-bottom: 24px;
}

.sp-connection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .sp-connection-grid {
        grid-template-columns: 1fr;
    }
}

.sp-connection-grid p {
    margin: 4px 0;
    font-size: 13px;
}

.sp-key-mask {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.sp-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sp-status-badge.connected {
    background: #d4edda;
    color: #155724;
}

.sp-status-badge.disconnected {
    background: #f8d7da;
    color: #721c24;
}

/* ── License Activation Section ── */
#sp-license-notice {
    margin: 10px 0;
    padding: 8px 12px;
    border-radius: 4px;
}

#sp-license-notice.notice-error {
    background: #fcf0f1;
    border-left: 4px solid #d63638;
}

#sp-license-notice.notice-success {
    background: #edfaef;
    border-left: 4px solid #00a32a;
}

#sp-license-section .sp-form-group {
    margin-bottom: 15px;
}

#sp-license-section .sp-form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
}

#sp-license-section .sp-form-group input {
    width: 100%;
    max-width: 400px;
}

/* ── Account Page ── */
.smallpict-account-table {
    border: none;
}

.smallpict-account-table td {
    padding: 12px 0;
    vertical-align: top;
}

.smallpict-account-table td:first-child {
    width: 140px;
    font-weight: 600;
}
