/* ==========================================================================
   payment.css
   Shared stylesheet for the payment gateway selection page (Payment/Index)
   and the payment receipt/result page (Payment/Result). Merged so both
   pages ship a single stylesheet instead of duplicating tokens and rules.
   ========================================================================== */

@font-face {
    font-family: YekanBakhFaNum;
    font-style: normal;
    font-weight: 600;
    src: url('fonts/woff/YekanBakhFaNum-SemiBold.woff') format('woff'), url('fonts/woff2/YekanBakhFaNum-SemiBold.woff2') format('woff2');
}

@font-face {
    font-family: YekanBakhFaNum;
    font-style: normal;
    font-weight: bold;
    src: url('fonts/woff/YekanBakhFaNum-Bold.woff') format('woff'), url('fonts/woff2/YekanBakhFaNum-Bold.woff2') format('woff2');
}

:root {
    --paper: #F4F6F3;
    --card: #FFFFFF;
    --ink: #17241F;
    --ink-soft: #5B6B62;
    --accent: #1E7A56;
    --accent-hover: #176B4A;
    --accent-soft: #E4F1EA;
    --danger: #B3462C;
    --danger-hover: #9A3A24;
    --danger-soft: #F6E7E2;
    --amber: #C6873B;
    --amber-soft: #F7ECDB;
    --line: #DFE5E0;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--paper);
    font-family: YekanBakhFaNum, Tahoma, sans-serif;
    color: var(--ink);
    font-feature-settings: 'tnum' 1;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 16px;
    position: relative;
    overflow-x: hidden;
}

    body::before {
        content: "";
        position: fixed;
        inset: 0;
        background-image: repeating-radial-gradient(circle at 20% 30%, rgba(30,122,86,0.05) 0px, rgba(30,122,86,0.05) 1px, transparent 1px, transparent 46px), repeating-radial-gradient(circle at 80% 75%, rgba(198,135,59,0.05) 0px, rgba(198,135,59,0.05) 1px, transparent 1px, transparent 54px);
        pointer-events: none;
    }

/* --------------------------------------------------------------------
   Payment (gateway selection) page
   -------------------------------------------------------------------- */

.payment-card {
    width: 100%;
    max-width: 600px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 38px 40px 36px;
    position: relative;
    box-shadow: 0 1px 3px rgba(23,36,31,0.04), 0 10px 28px rgba(23,36,31,0.07);
}

.brand-top {
    margin: 0 0 22px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: var(--ink);
}

.hero-amount {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
    text-align: center;
    margin-top: 4px;
    margin-bottom: 24px;
}

    .hero-amount .label {
        font-size: 13px;
        color: var(--ink-soft);
        font-weight: 600;
        white-space: nowrap;
    }

    .hero-amount .val {
        font-size: 26px;
        font-weight: bold;
        color: var(--accent);
        letter-spacing: -0.8px;
        white-space: nowrap;
    }

    .hero-amount .unit {
        font-size: 15px;
        font-weight: 500;
        color: var(--ink-soft);
        margin-inline-start: 4px;
    }

@media (max-width:400px) {
    .hero-amount .val {
        font-size: 22px;
    }
}

.session-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--ink-soft);
    margin-bottom: 22px;
    transition: color .2s ease;
}

    .session-timer .timer-icon {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    .session-timer #timer_value {
        font-weight: bold;
        color: var(--ink);
        font-feature-settings: 'tnum' 1;
        transition: color .2s ease;
    }

    .session-timer.is-warning {
        color: var(--danger);
    }

        .session-timer.is-warning #timer_value {
            color: var(--danger);
        }

    .session-timer.is-expired {
        color: var(--danger);
        font-weight: 600;
    }

.meta {
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
}

.section-title h2 {
    font-size: 15.5px;
    font-weight: bold;
    margin: 0 0 4px;
    color: var(--ink);
}

.section-title p {
    font-size: 13px;
    color: var(--ink-soft);
    margin: 0 0 16px;
}

.gateway-grid {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 10px;
    margin-bottom: 24px;
}

@media (min-width:680px) {
    .gateway-grid {
        grid-template-columns: repeat(4,1fr);
    }
}

.gateway-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.gateway-item {
    position: relative;
}

    .gateway-item label {
        display: flex;
        align-items: center;
        justify-content: center;
        aspect-ratio: 1/1;
        padding: 10px 8px;
        border: 1.5px solid var(--line);
        border-radius: 12px;
        background: var(--card);
        cursor: pointer;
        transition: border-color .15s ease,border-width .15s ease;
    }

        .gateway-item label img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }

.gateway-radio:checked + label {
    border-color: var(--accent);
    border-width: 2px;
}

.check-badge {
    position: absolute;
    top: -7px;
    left: -7px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(.6);
    transition: opacity .15s ease,transform .15s ease;
}

    .check-badge svg {
        width: 11px;
        height: 11px;
    }

.gateway-radio:checked + label .check-badge {
    opacity: 1;
    transform: scale(1);
}

.gateway-radio:focus-visible + label {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Inline error / notice banner shown on the payment form (AJAX failures) */
.alert-box {
    display: none;
    align-items: flex-start;
    gap: 12px;
    background: var(--danger-soft);
    border-radius: 10px;
    padding: 16px 16px;
    margin-bottom: 22px;
}

    .alert-box.show {
        display: flex;
    }

    .alert-box .alert-icon {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        color: var(--danger);
        margin-top: 1px;
    }

    .alert-box .alert-content {
        flex: 1;
        min-width: 0;
    }

    .alert-box .alert-text {
        margin: 0;
        font-size: 13px;
        line-height: 1.7;
        color: var(--ink);
    }

    .alert-box .alert-retry-btn {
        display: none;
        margin-top: 10px;
        padding: 8px 16px;
        background: transparent;
        border: 1.5px solid var(--danger);
        border-radius: 8px;
        font-family: inherit;
        font-size: 12.5px;
        font-weight: 600;
        color: var(--danger);
        cursor: pointer;
        transition: background .15s ease,color .15s ease;
    }

        .alert-box .alert-retry-btn.show {
            display: inline-flex;
        }

        .alert-box .alert-retry-btn:hover {
            background: var(--danger);
            color: #fff;
        }

/* jquery.validate.unobtrusive toggles the summary div between these two
   classes; the "valid" state renders an empty <ul> that would otherwise
   leave a stray gap now that Bootstrap's reset isn't loaded. */
.validation-summary-valid {
    display: none;
}

    .validation-summary-valid ul {
        display: none;
    }

.validation-summary-errors {
    background: var(--danger-soft);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

    .validation-summary-errors ul {
        margin: 0;
        padding-inline-start: 18px;
        list-style: disc;
    }

        .validation-summary-errors ul li {
            color: var(--danger);
            font-size: 13px;
            line-height: 1.8;
        }

.actions {
    display: flex;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 18px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease,border-color .15s ease,color .15s ease;
}

.btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-cancel {
    flex: 0 0 auto;
    padding-left: 20px;
    padding-right: 20px;
    background: var(--paper);
    color: var(--ink-soft);
    border: 1.5px solid var(--line);
}

    .btn-cancel:hover {
        border-color: var(--danger);
        color: var(--danger);
    }

.btn-pay {
    flex: 1;
    padding: 15px 18px;
    font-size: 15px;
    background: var(--accent);
    color: #fff;
    border: 1.5px solid var(--accent);
}

    .btn-pay:hover {
        background: var(--accent-hover);
        border-color: var(--accent-hover);
    }

    .btn-pay:disabled {
        opacity: .6;
        cursor: not-allowed;
    }

.indicator-progress {
    display: none;
    align-items: center;
    gap: 7px;
}

.indicator-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

[data-kt-indicator=on] .indicator-progress {
    display: inline-flex;
}

[data-kt-indicator=on] .indicator-label {
    display: none;
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width:460px) {
    .payment-card {
        padding: 26px 20px 24px;
        border-radius: 16px;
    }
}

/* --------------------------------------------------------------------
   Receipt / result page
   -------------------------------------------------------------------- */

.receipt {
    z-index:9;
    width: 100%;
    max-width: 380px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(23,36,31,0.04), 0 10px 28px rgba(23,36,31,0.07);
}

    .receipt.receipt-lg {
        max-width: 480px;
        border-radius: 20px;
    }

.brand {
    font-weight: bolder;
    color: var(--accent);
    font-size: 13.5px;
}

.receipt-body {
    padding: 28px 30px 28px;
}

.receipt-lg .receipt-body {
    padding: 50px 40px 44px;
}

.status {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    margin-bottom: 24px;
}

    .status.status-lg {
        gap: 18px;
    }

        .status.status-lg h1 {
            font-size: 19px;
        }

        .status.status-lg p {
            font-size: 14px;
            max-width: 300px;
            line-height: 1.8;
        }

.status-ring {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

    .status-ring circle {
        fill: none;
        stroke-width: 3;
    }

    .status-ring path, .status-ring line {
        fill: none;
        stroke-width: 4;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .status-ring.success circle {
        stroke: var(--accent);
    }

    .status-ring.success path {
        stroke: var(--accent);
        stroke-dasharray: 33;
        stroke-dashoffset: 33;
        animation: draw 0.5s 0.35s cubic-bezier(.65,0,.35,1) forwards;
    }

    .status-ring.failure circle {
        stroke: var(--danger);
    }

    .status-ring.failure line {
        stroke: var(--danger);
        stroke-dasharray: 26;
        stroke-dashoffset: 26;
        animation: draw 0.4s 0.35s cubic-bezier(.65,0,.35,1) forwards;
    }

        .status-ring.failure line:last-of-type {
            animation-delay: 0.55s;
        }

@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

.status h1 {
    font-size: 17px;
    font-weight: bold;
    margin: 0;
    line-height: 1.6;
}

.status p {
    margin: 0;
    font-size: 13px;
    color: var(--ink-soft);
    font-weight: 400;
    line-height: 1.7;
}

/* Generic error page — animated payment-card character */
.error-char {
    width: 168px;
    height: auto;
    overflow: visible;
}

    .error-char .float {
        animation: char-float 3.2s ease-in-out infinite;
        transform-origin: 80px 95px;
    }

    .error-char .eye {
        animation: char-blink 4.5s ease-in-out infinite;
        transform-origin: center;
    }

        .error-char .eye.eye-r {
            animation-delay: .06s;
        }

    .error-char .signal-1 {
        animation: char-signal 2.6s ease-in-out infinite;
    }

    .error-char .signal-2 {
        animation: char-signal 2.6s ease-in-out infinite .25s;
    }

    .error-char .signal-3 {
        animation: char-signal 2.6s ease-in-out infinite .5s;
    }

    .error-char .slash {
        animation: char-flash 2.6s ease-in-out infinite;
    }

@keyframes char-float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-7px) rotate(-2deg);
    }
}

@keyframes char-blink {
    0%, 88%, 100% {
        transform: scaleY(1);
    }

    94% {
        transform: scaleY(.15);
    }
}

@keyframes char-signal {
    0%, 100% {
        opacity: .2;
    }

    50% {
        opacity: .75;
    }
}

@keyframes char-flash {
    0%, 100% {
        opacity: .55;
    }

    50% {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .error-char .float, .error-char .eye, .error-char .signal-1, .error-char .signal-2, .error-char .signal-3, .error-char .slash {
        animation: none !important;
    }
}

/* Bank gateway redirect page — shown briefly while the auto-submit form
   sends the user to the selected bank's IPG */
.gateway-connect {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

.gateway-connect-ring {
    position: relative;
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
}

.gateway-connect-spinner {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid var(--accent-soft);
    border-top-color: var(--accent);
    animation: spin .9s linear infinite;
}

.gateway-connect-icon {
    position: absolute;
    inset: 11px;
    border-radius: 50%;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .gateway-connect-icon svg {
        width: 22px;
        height: 22px;
        color: var(--accent);
    }

.gateway-connect h1 {
    font-size: 16.5px;
    font-weight: bold;
    margin: 0;
    line-height: 1.6;
}

.gateway-connect p {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.8;
}

    .gateway-connect p strong {
        color: var(--ink);
        font-weight: bold;
    }

/* Shared divider + key/value row, used on both the payment form and the receipt */
.divider {
    border: none;
    border-top: 1.5px dashed var(--line);
    margin: 22px 0;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: 13px;
    padding: 12px 2px;
    border-bottom: 1.5px dashed var(--line);
}

    .meta-row:last-child {
        border-bottom: none;
    }

    .meta-row .label {
        color: var(--ink-soft);
        font-weight: 400;
        flex-shrink: 0;
    }

    .meta-row .val {
        font-weight: 600;
        color: var(--ink);
        text-align: left;
        font-feature-settings: 'tnum' 1;
    }

    .meta-row .val-group {
        display: flex;
        align-items: center;
        gap: 6px;
    }

.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--ink-soft);
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
}

    .copy-btn:hover {
        color: var(--accent);
        background: var(--accent-soft);
    }

    .copy-btn:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }

    .copy-btn .icon-check {
        display: none;
    }

    .copy-btn.copied {
        color: var(--accent);
    }

        .copy-btn.copied .icon-copy {
            display: none;
        }

        .copy-btn.copied .icon-check {
            display: inline-flex;
        }

.redirect {
    background: var(--accent-soft);
    border-radius: 10px;
    padding: 20px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
}

    .redirect.failure {
        background: var(--danger-soft);
    }

.ring-wrap {
    position: relative;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
}

    .ring-wrap svg {
        width: 100%;
        height: 100%;
        transform: rotate(-90deg);
    }

.ring-track {
    fill: none;
    stroke: #CFE3D8;
    stroke-width: 4;
}

.redirect.failure .ring-track {
    stroke: #E7CFC5;
}

.ring-progress {
    fill: none;
    stroke: var(--amber);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 125.6;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.ring-count {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: var(--amber);
    font-feature-settings: 'tnum' 1;
}

.redirect-text {
    flex: 1;
    min-width: 0;
}

    .redirect-text p {
        margin: 0;
        font-size: 13px;
        line-height: 1.7;
    }

    .redirect-text .sub {
        color: var(--ink-soft);
        font-size: 12px;
        margin-top: 2px;
    }

/* shown only when the auto/manual redirect hasn't navigated away after a timeout —
   reassures the user the transaction itself is unaffected and offers a manual retry */
.fallback {
    display: none;
    background: var(--amber-soft);
    border-radius: 10px;
    padding: 20px 18px;
    text-align: center;
}

    .fallback.show {
        display: block;
    }

    .fallback p {
        margin: 0;
        font-size: 13px;
        line-height: 1.7;
    }

    .fallback .sub {
        color: var(--ink-soft);
        font-size: 12px;
        margin-top: 6px;
    }

    .fallback .manual-btn {
        margin-top: 14px;
    }

.manual-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 13px;
    background: transparent;
    border: 1.5px solid var(--line);
    border-radius: 9px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

    .manual-btn:hover {
        border-color: var(--accent);
        background: #FBFDFC;
    }

    .manual-btn:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }

/* Shared page footnote (used as the small brand tagline under the payment
   card and as the closing note on the receipt) */
.footnote {
    text-align: center;
    font-size: 12.5px;
    color: var(--ink-soft);
    margin-top: 22px;
    line-height: 1.8;
}

.live-region {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

@media (prefers-reduced-motion: reduce) {
    .status-ring path, .status-ring line {
        animation: none !important;
        stroke-dashoffset: 0 !important;
    }

    .ring-progress {
        transition: none;
    }
}

@media (max-width:380px) {
    .receipt-body {
        padding: 14px 20px 22px;
    }
}

/* --------------------------------------------------------------------
   Home page (root domain landing / uptime-check page)
   -------------------------------------------------------------------- */

.home-card {
    width: 100%;
    max-width: 540px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 1px 3px rgba(23,36,31,0.04), 0 12px 32px rgba(23,36,31,0.08);
    padding: 48px 40px 42px;
    text-align: center;
    z-index:9;
}

.mascot-wrap {
    position: relative;
    width: 220px;
    height: 210px;
    margin: 0 auto 10px;
}

.mascot-glow {
    position: absolute;
    inset: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(30,122,86,0.28) 0%, rgba(30,122,86,0) 70%);
    animation: glow-pulse 3.4s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        opacity: .6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}

.orbit-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.orbit-group {
    transform-origin: 110px 105px;
    animation: orbit-spin 13s linear infinite;
}

@keyframes orbit-spin {
    to {
        transform: rotate(360deg);
    }
}

.mascot-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90px;
    height: auto;
    animation: logo-float 3.6s ease-in-out infinite;
}

@keyframes logo-float {
    0%, 100% {
        transform: translate(-50%,-50%) translateY(0);
    }

    50% {
        transform: translate(-50%,-50%) translateY(-7px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mascot-glow, .orbit-group, .mascot-logo {
        animation: none !important;
    }

    .mascot-logo {
        transform: translate(-50%,-50%);
    }
}

.home-card h1 {
    font-size: 30px;
    font-weight: 800;
    margin: 6px 0 18px;
    color: var(--ink);
    letter-spacing: -.3px;
}

.feature-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 700;
    padding: 7px 13px;
    border-radius: 999px;
}

    .feature-pill svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

.home-card .caption {
    font-size: 13.5px;
    color: var(--ink-soft);
    line-height: 1.9;
    margin: 0 auto 24px;
    max-width: 320px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 999px;
}

.status-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

    .status-dot::after {
        content: "";
        position: absolute;
        inset: -5px;
        border-radius: 50%;
        border: 2px solid var(--accent);
        opacity: .55;
        animation: pulse-ring 1.8s ease-out infinite;
    }

@keyframes pulse-ring {
    0% {
        transform: scale(.5);
        opacity: .6;
    }

    100% {
        transform: scale(2.1);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .status-dot::after {
        animation: none;
        display: none;
    }
}
