/* =========================
   Maktaaral Teachers – Frontend
   ========================= */

.mt-box {
    max-width: 720px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.mt-box h2 {
    margin-bottom: 20px;
    font-size: 24px;
    text-align: center;
}

/* =========================
   Messages
   ========================= */
.mt-success, .mt-success-msg {
    background: #e6f7ec;
    color: #0a7a3d;
    border-left: 5px solid #0a7a3d;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 6px;
}
.mt-error, .mt-error-msg {
    background: #fdeaea;
    color: #a40000;
    border-left: 5px solid #a40000;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 6px;
}
.mt-msg {
    margin: 10px 0;
    border-radius: 6px;
    padding: 10px 14px;
}
.mt-info-notice {
    background: #e8f0fe;
    color: #1a56db;
    border-left: 5px solid #1a56db;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-size: 14px;
}

/* =========================
   Status Badges
   ========================= */
.mt-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.mt-badge-publish {
    background: #e6f7ec;
    color: #0a7a3d;
}
.mt-badge-pending {
    background: #fff3cd;
    color: #7a5300;
}
.mt-badge-draft {
    background: #fdeaea;
    color: #a40000;
}

.mt-rejection-reason {
    color: #a40000;
    font-size: 12px;
    display: block;
    margin-top: 3px;
}

/* =========================
   Form Layout
   ========================= */
.mt-form,
.mt-box form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.mt-form label {
    font-weight: 600;
    font-size: 14px;
}
.mt-form input[type="text"],
.mt-form input[type="email"],
.mt-form textarea,
.mt-form input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #d0d7de;
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s;
}
.mt-form textarea {
    resize: vertical;
    min-height: 160px;
}
.mt-form input:focus,
.mt-form textarea:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

/* =========================
   User Info
   ========================= */
.mt-user-info {
    background: #f6f8fa;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
}
.mt-user-info p { margin: 4px 0; }

/* =========================
   Counter
   ========================= */
.mt-counter {
    font-size: 14px;
    color: #444;
    background: #f6f8fa;
    padding: 8px 12px;
    border-radius: 6px;
}

/* =========================
   Kaspi
   ========================= */
.kaspi-num {
    background: #fff3cd;
    border-left: 5px solid #ffb703;
    padding: 12px;
    border-radius: 6px;
    font-size: 15px;
}
.kaspi-num h4 { margin: 0; font-weight: 700; }

/* =========================
   Gallery
   ========================= */
.mt-form small { font-size: 12px; color: #666; }
#gallery-1 { margin-bottom: 30px; }

/* =========================
   reCAPTCHA
   ========================= */
.g-recaptcha { margin: 10px 0; }

/* =========================
   Submit Button
   ========================= */
.mt-btn,
.mt-box button {
    margin-top: 10px;
    color: #fff;
    border: none;
    padding: 12px;
    font-size: 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background .2s;
}
.mce-widget button:hover { background: none !important; }
.mt-btn:hover,
.mt-box button:hover { background: #2271b1; }

/* =========================
   Responsive
   ========================= */
@media (max-width: 600px) {
    .mt-box { padding: 20px; }
    .mt-box h2 { font-size: 20px; }
}

/* =========================
   Жеке кабинет v2 (mtc-)
   ========================= */

/* Notice */
.mtc-notice {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    animation: mtc-fadein .3s ease;
}
.mtc-notice-success { background:#e6f7ec; color:#0a7a3d; border-left:4px solid #0a7a3d; }
.mtc-notice-error   { background:#fdeaea; color:#a40000; border-left:4px solid #a40000; }
@keyframes mtc-fadein { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:none} }

.mtc-login-notice { text-align:center; padding:40px; color:#666; }

/* Wrapper */
.mtc-wrap {
    max-width: 1100px;
    margin: 0 auto;
    font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    color: #1d2327;
}

/* ── STATS BAR ── */
.mtc-stats-bar {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 14px;
    margin-bottom: 24px;
}
.mtc-stat-card {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    padding: 18px 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    transition: transform .15s, box-shadow .15s;
}
.mtc-stat-card:hover { transform:translateY(-2px); box-shadow:0 4px 16px rgba(0,0,0,.09); }
.mtc-stat-n {
    display: block;
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    color: #1d2327;
}
.mtc-stat-l { display:block; font-size:12px; color:#888; margin-top:5px; font-weight:500; }
.mtc-stat-card.green .mtc-stat-n { color:#0a7a3d; }
.mtc-stat-card.amber .mtc-stat-n { color:#b45309; }
.mtc-stat-card.blue  .mtc-stat-n { color:#1a56db; }

/* ── LAYOUT ── */
.mtc-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* ── SIDEBAR ── */
.mtc-aside {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
}
.mtc-profile-card {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 14px;
    padding: 24px 16px 18px;
    text-align: center;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.mtc-av-wrap {
    width: 96px; height: 96px;
    border-radius: 50%;
    margin: 0 auto 14px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 3px solid #e8ecf0;
    transition: border-color .2s;
}
.mtc-av-wrap:hover { border-color: #2271b1; }
.mtc-av-img { width:100%; height:100%; object-fit:cover; display:block; }
.mtc-av-overlay {
    position: absolute; inset:0;
    background: rgba(15,42,68,.55);
    display: flex; align-items:center; justify-content:center;
    opacity: 0; transition: opacity .2s;
}
.mtc-av-wrap:hover .mtc-av-overlay { opacity:1; }
.mtc-av-name  { font-size:15px; font-weight:700; color:#1d2327; line-height:1.3; }
.mtc-av-pos   { font-size:12px; color:#666; margin-top:4px; }
.mtc-av-school{ font-size:11px; color:#888; margin-top:3px; }
.mtc-del-av   { font-size:11px; color:#a40000; background:none; border:none; cursor:pointer; padding:2px 6px; border-radius:4px; }
.mtc-del-av:hover { background:#fdeaea; }

.mtc-nav { display:flex; flex-direction:column; gap:4px; }
.mtc-nav-btn {
    display: flex; align-items: center; gap: 9px;
    width: 100%; padding: 10px 14px;
    background: #fff; border: 1px solid #e8ecf0;
    border-radius: 9px; cursor:pointer;
    font-size: 13px; font-weight: 600; color: #444;
    text-decoration: none; text-align:left;
    transition: background .15s, color .15s, border-color .15s;
    position: relative;
}
.mtc-nav-btn:hover  { background:#f0f4f8; color:#1d2327; border-color:#c8d3dc; }
.mtc-nav-btn.active { background:#0f2a44; color:#fff; border-color:#0f2a44; }
.mtc-nav-btn svg    { flex-shrink:0; opacity:.7; }
.mtc-nav-btn.active svg { opacity:1; }
.mtc-nav-logout     { color:#a40000 !important; margin-top:8px; }
.mtc-nav-logout:hover { background:#fdeaea !important; border-color:#f5c6c6 !important; }
.mtc-nav-count {
    margin-left:auto; background:#e8ecf0; color:#444;
    font-size:11px; font-weight:700; padding:1px 7px;
    border-radius:10px; min-width:20px; text-align:center;
}
.mtc-nav-btn.active .mtc-nav-count { background:rgba(255,255,255,.25); color:#fff; }

/* ── MAIN ── */
.mtc-main { flex:1; min-width:0; }
.mtc-tab  { display:none; }
.mtc-tab.active { display:block; }

.mtc-tab-head {
    display: flex; align-items:center; justify-content:space-between;
    margin-bottom: 20px; gap:12px; flex-wrap:wrap;
}
.mtc-tab-head h2 { margin:0; font-size:20px; color:#1d2327; }

/* ── BUTTONS ── */
.mtc-btn {
    display: inline-flex; align-items:center; gap:6px;
    padding: 9px 18px; border-radius: 8px; border:none;
    font-size: 13px; font-weight: 700; cursor: pointer;
    text-decoration: none; transition: background .15s, transform .1s;
    line-height: 1;
}
.mtc-btn:active { transform:scale(.97); }
.mtc-btn-primary { background:#0f2a44; color:#fff; }
.mtc-btn-primary:hover { background:#2271b1; color:#fff; }
.mtc-btn-new { background:#059669; color:#fff; }
.mtc-btn-new:hover { background:#047857; color:#fff; }

/* ── INFO GRID ── */
.mtc-info-grid {
    display: grid; grid-template-columns:1fr 1fr; gap:1px;
    background: #e8ecf0; border-radius:12px; overflow:hidden;
    margin-bottom: 24px; border:1px solid #e8ecf0;
}
.mtc-info-item {
    background:#fff; padding:14px 18px;
    display:flex; flex-direction:column; gap:3px;
}
.mtc-info-lbl { font-size:11px; color:#888; font-weight:600; text-transform:uppercase; letter-spacing:.4px; }
.mtc-info-val  { font-size:14px; color:#1d2327; font-weight:500; word-break:break-all; }

.mtc-divider { border:none; border-top:1px solid #e8ecf0; margin:20px 0; }
.mtc-sub-h   { font-size:15px; color:#1d2327; margin:0 0 16px; }

/* ── FORM ── */
.mtc-form { display:flex; flex-direction:column; gap:16px; max-width:480px; }
.mtc-form-row { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.mtc-fg { display:flex; flex-direction:column; gap:6px; }
.mtc-fg label { font-size:13px; font-weight:600; color:#444; }
.mtc-fg input[type="text"],
.mtc-fg input[type="password"] {
    padding: 10px 12px; border:1px solid #d0d7de; border-radius:8px;
    font-size:14px; transition:border-color .2s,box-shadow .2s;
    color:#1d2327; background:#fff;
}
.mtc-fg input:focus { border-color:#2271b1; outline:none; box-shadow:0 0 0 3px rgba(34,113,177,.12); }

/* ── ARTICLES ── */
.mtc-articles { display:flex; flex-direction:column; gap:10px; }
.mtc-article {
    background: #fff; border:1px solid #e8ecf0; border-radius:12px;
    padding: 16px 18px; display:flex; align-items:center; gap:16px;
    transition: box-shadow .15s, border-color .15s;
}
.mtc-article:hover { box-shadow:0 4px 16px rgba(0,0,0,.07); border-color:#c8d3dc; }
.mtc-article.is-pub  { border-left:4px solid #0a7a3d; }
.mtc-article.is-rejected { border-left:4px solid #a40000; background:#fffafa; }

.mtc-a-body { flex:1; min-width:0; }
.mtc-a-title { font-size:14px; font-weight:600; color:#1d2327; margin-bottom:5px; line-height:1.4; }
.mtc-a-title a { color:#1d2327; text-decoration:none; }
.mtc-a-title a:hover { color:#2271b1; text-decoration:underline; }
.mtc-a-meta { display:flex; gap:14px; font-size:12px; color:#888; flex-wrap:wrap; }
.mtc-a-reject {
    margin-top:7px; font-size:12px; color:#a40000;
    background:#fdeaea; border-radius:6px; padding:6px 10px;
    display:flex; gap:5px; align-items:flex-start; line-height:1.4;
}

.mtc-a-right { display:flex; flex-direction:column; align-items:flex-end; gap:6px; flex-shrink:0; min-width:100px; }
.mtc-a-status {}
.mtc-a-payment {}
.mtc-a-actions { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }

.mtc-paid   { display:inline-block; padding:3px 10px; border-radius:12px; font-size:12px; font-weight:600; background:#e6f7ec; color:#0a7a3d; }
.mtc-manual { display:inline-block; padding:3px 10px; border-radius:12px; font-size:12px; font-weight:600; background:#fff3cd; color:#7a5300; }
.mtc-pay-cta {
    display:inline-block; padding:5px 12px; border-radius:8px;
    font-size:12px; font-weight:700; background:#ff640a; color:#fff;
    text-decoration:none; transition:background .15s;
    white-space:nowrap;
}
.mtc-pay-cta:hover { background:#e05500; color:#fff; }

.mtc-act-btn {
    display:inline-block; padding:4px 10px; border-radius:6px;
    font-size:12px; font-weight:600; color:#555;
    background:#f0f4f8; border:1px solid #e0e5ea;
    text-decoration:none; transition:background .15s, color .15s;
    white-space:nowrap;
}
.mtc-act-btn:hover { background:#e4ebf1; color:#1d2327; }
.mtc-act-cert { color:#0a7a3d !important; background:#e6f7ec !important; border-color:#b7e4c7 !important; }
.mtc-act-cert:hover { background:#c3efce !important; }

/* Empty state */
.mtc-empty {
    text-align:center; padding:48px 24px;
    background:#f8fafc; border-radius:12px; border:2px dashed #e0e5ea;
    color:#888;
}
.mtc-empty-ico { font-size:48px; margin-bottom:12px; }
.mtc-empty p  { font-size:15px; margin:0 0 4px; }

/* Comments */
.mtc-comments { display:flex; flex-direction:column; gap:10px; }
.mtc-comment  {
    background:#fff; border:1px solid #e8ecf0; border-radius:10px; padding:14px 16px;
}
.mtc-comment-text { margin:0 0 8px; font-size:14px; color:#333; line-height:1.5; }
.mtc-comment-meta { display:flex; align-items:center; justify-content:space-between; font-size:12px; color:#888; }
.mtc-comment-meta a { color:#2271b1; text-decoration:none; font-weight:600; }
.mtc-comment-meta a:hover { text-decoration:underline; }

/* Legacy compat */
.mt-tab { display:none; }
.mt-tab.active { display:block; }
.button-small { padding:2px 8px !important; font-size:12px !important; }

/* ── MOBILE ── */
@media (max-width: 900px) {
    .mtc-stats-bar { grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 768px) {
    .mtc-layout { flex-direction:column; }
    .mtc-aside   { width:100%; position:static; }
    .mtc-nav     { flex-direction:row; flex-wrap:wrap; gap:6px; }
    .mtc-nav-btn { width:auto; padding:8px 12px; font-size:12px; flex:1; min-width:130px; justify-content:center; }
    .mtc-nav-logout { flex:none; width:auto; }
    .mtc-profile-card { display:flex; align-items:center; gap:16px; text-align:left; padding:16px; }
    .mtc-av-wrap { width:70px; height:70px; margin:0; flex-shrink:0; }
    .mtc-article { flex-wrap:wrap; }
    .mtc-a-right { flex-direction:row; align-items:center; flex-wrap:wrap; width:100%; min-width:unset; justify-content:flex-start; }
    .mtc-info-grid { grid-template-columns:1fr; }
    .mtc-form-row  { grid-template-columns:1fr; }
    .mtc-tab-head  { flex-direction:column; align-items:flex-start; }
}
@media (max-width: 480px) {
    .mtc-stats-bar { grid-template-columns:repeat(2,1fr); gap:8px; }
    .mtc-stat-n    { font-size:24px; }
    .mtc-article   { padding:12px 14px; }
}

/* =========================
   Төлем беті (Payment Page)
   ========================= */
.mt-payment-page {
    max-width: 560px;
    margin: 40px auto;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Order summary card */
.mt-order-summary {
    background: #f6f8fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 24px;
}
.mt-order-summary h3 {
    margin: 0 0 14px;
    font-size: 17px;
    color: #1d2327;
}
.mt-order-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px solid #e8e8e8;
}
.mt-order-row:last-child { border-bottom: none; }
.mt-order-row .label { color: #666; }
.mt-order-row .value { font-weight: 600; color: #1d2327; }
.mt-order-total .value {
    font-size: 20px;
    color: #0a7a3d;
}

/* Payment method tabs */
.mt-pay-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 24px;
}
.mt-pay-tab-btn {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    transition: color .15s, border-color .15s;
}
.mt-pay-tab-btn:hover { color: #1d2327; }
.mt-pay-tab-btn.active {
    color: #0f2a44;
    border-bottom-color: #0f2a44;
}

/* Tab content */
.mt-pay-tab-content { display: none; }
.mt-pay-tab-content.active { display: block; }

/* ─── KASPI QR ─── */
.mt-kaspi-qr-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 16px;
}
.mt-qr-canvas-box {
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
}
.mt-qr-canvas-box canvas,
.mt-qr-canvas-box img { max-width: 200px; max-height: 200px; }

/* Spinner */
.mt-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid #e0e0e0;
    border-top-color: #ff640a;
    border-radius: 50%;
    animation: mt-spin .8s linear infinite;
}
@keyframes mt-spin { to { transform: rotate(360deg); } }

.mt-kaspi-logo {
    height: 28px;
    margin-bottom: 4px;
}

/* Kaspi status messages */
.mt-qr-status {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    padding: 6px 14px;
    border-radius: 20px;
    background: #f6f8fa;
    color: #444;
}
.mt-qr-status.pending  { background: #fff3cd; color: #7a5300; }
.mt-qr-status.success  { background: #e6f7ec; color: #0a7a3d; }
.mt-qr-status.failed   { background: #fdeaea; color: #a40000; }
.mt-qr-status.expired  { background: #f6f8fa; color: #666; }

/* Countdown */
.mt-countdown {
    font-size: 13px;
    color: #888;
    text-align: center;
}
.mt-countdown span {
    font-weight: 700;
    color: #444;
}

/* Refresh button */
.mt-refresh-btn {
    padding: 8px 18px;
    background: #ff640a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.mt-refresh-btn:hover { background: #e05500; }

/* App link hint */
.mt-kaspi-hint {
    font-size: 12px;
    color: #888;
    text-align: center;
    line-height: 1.5;
}
.mt-kaspi-hint a { color: #ff640a; font-weight: 600; }

/* ─── HALYK CARD ─── */
.mt-card-wrap {
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.mt-card-logos {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.mt-card-logos img {
    height: 28px;
    opacity: .85;
}
.mt-card-amount-box {
    background: #f6f8fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}
.mt-card-amount-box .amount {
    font-size: 22px;
    font-weight: 700;
    color: #0a7a3d;
}
.mt-pay-card-btn {
    width: 100%;
    padding: 14px;
    background: #0f2a44;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
    letter-spacing: .3px;
}
.mt-pay-card-btn:hover { background: #2271b1; }
.mt-pay-card-btn:disabled {
    background: #aaa;
    cursor: not-allowed;
}
.mt-halyk-secure {
    font-size: 12px;
    color: #888;
    text-align: center;
}
.mt-halyk-secure span { color: #0a7a3d; font-weight: 600; }

/* ─── PAYMENT RESULT ─── */
.mt-payment-result {
    max-width: 480px;
    margin: 60px auto;
    text-align: center;
    padding: 40px 32px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.mt-payment-result .icon {
    font-size: 56px;
    margin-bottom: 16px;
    display: block;
}
.mt-payment-result h2 {
    margin: 0 0 12px;
    font-size: 26px;
}
.mt-payment-result p {
    color: #555;
    font-size: 15px;
    margin-bottom: 24px;
}
.mt-payment-result.success h2 { color: #0a7a3d; }
.mt-payment-result.error   h2 { color: #a40000; }

.mt-result-detail {
    background: #f6f8fa;
    border-radius: 8px;
    padding: 14px 18px;
    text-align: left;
    font-size: 14px;
    margin-bottom: 20px;
}
.mt-result-detail p { margin: 6px 0; color: #444; }
.mt-result-detail strong { color: #1d2327; }

.mt-back-btn {
    display: inline-block;
    padding: 12px 28px;
    background: #0f2a44;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: background .2s;
}
.mt-back-btn:hover { background: #2271b1; color: #fff; }

/* Already paid notice */
.mt-already-paid {
    background: #e6f7ec;
    border: 1px solid #0a7a3d;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    font-size: 15px;
    color: #0a7a3d;
    font-weight: 600;
}

/* Security badge */
.mt-secure-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: #888;
    margin-top: 16px;
}

/* =========================
   Responsive — Payment
   ========================= */
@media (max-width: 600px) {
    .mt-payment-page { margin: 20px 16px; }
    .mt-qr-canvas-box { width: 180px; height: 180px; }
    .mt-qr-canvas-box canvas,
    .mt-qr-canvas-box img { max-width: 160px; max-height: 160px; }
    .mt-pay-tab-btn { font-size: 13px; padding: 10px 8px; }
}
