/* =========================
   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; }
}

/* =========================
   Жеке кабинет
   ========================= */
.mt-profile { max-width: 900px; margin: 0 auto; }
.mt-profile h2 { margin-top: 30px; }

.mt-table { width: 100%; border-collapse: collapse; }
.mt-table th,
.mt-table td { border: 1px solid #ddd; padding: 8px; vertical-align: middle; }
.mt-table th { background: #f5f5f5; }

.mt-profile ul li { list-style: none; }
.mt-profile ul li i { color: var(--nv-primary-accent, #2271b1); }

.mt-cabinet {
    display: flex;
    gap: 24px;
    max-width: 1200px;
    margin: 30px auto;
}

/* SIDEBAR */
.mt-sidebar {
    width: 260px;
    border-right: 1px solid #e5e7eb;
    padding-right: 16px;
    flex-shrink: 0;
}
.mt-tab-btn {
    display: block;
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    font-weight: 600;
    background: #fff;
    color: #1d2327;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.mt-tab-btn:hover { background: #f0f0f0; }
.mt-tab-btn.active { background: #0f2a44; color: #fff; border-color: #0f2a44; }
.mt-logout-btn { color: #a40000 !important; }
.mt-logout-btn:hover { background: #fdeaea !important; }

/* CONTENT */
.mt-content { flex: 1; min-width: 0; }
.mt-tab { display: none; }
.mt-tab.active { display: block; }

/* Profile info */
.mt-profile-info { padding: 0; margin: 0 0 16px; }
.mt-profile-info li { margin-bottom: 8px; list-style: none; }

/* Profile edit form */
.mt-edit-profile-form p { margin-bottom: 14px; }
.mt-edit-profile-form input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 8px 10px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 4px;
    display: block;
}

/* Password form */
.mt-password-form input {
    width: 100%;
    max-width: 320px;
    padding: 8px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    margin-top: 4px;
    display: block;
}

/* Avatar */
.mt-avatar-block {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}
.mt-avatar-block img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e5e7eb;
}

/* Button small */
.button-small { padding: 2px 8px !important; font-size: 12px !important; }

/* MOBILE */
@media (max-width: 768px) {
    .mt-cabinet { flex-direction: column; }
    .mt-sidebar { width: 100%; border-right: none; border-bottom: 1px solid #e5e7eb; padding-bottom: 12px; }
    .mt-tab-btn { display: inline-block; width: auto; margin-right: 4px; margin-bottom: 4px; }
}

/* =========================
   Төлем беті (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; }
}
