.otp-modal {
    --otp-brand: #00341a;
    --otp-brand-hover: #004d26;
    --otp-brand-active: #176b3c;
    --otp-surface-tint: #f3faf6;
    --otp-text: #23342b;
    --otp-border: #d3ded6;
    align-items: center !important;
    justify-content: center;
    padding: 16px !important;
}

.otp-modal.in,
.otp-modal.show,
.otp-modal[style*="display: block"] {
    display: flex !important;
}

.otp-modal .modal-dialog {
    width: 460px;
    max-width: 100%;
    margin: auto;
    transform: translateY(10px) scale(.985) !important;
    transition: transform .24s ease, opacity .24s ease;
}

.otp-modal.in .modal-dialog,
.otp-modal.show .modal-dialog {
    transform: translateY(0) scale(1) !important;
}

.otp-modal .modal-content {
    position: relative;
    max-height: calc(100vh - 32px) !important;
    overflow-x: hidden;
    overflow-y: auto;
    border: 0;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 24px 64px rgba(22, 38, 29, .22);
}

.otp-modal .otp-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1;
    display: grid;
    width: 36px;
    height: 36px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #536259;
    font-size: 26px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
}

.otp-modal .otp-modal-close:hover,
.otp-modal .otp-modal-close:focus-visible {
    background: var(--otp-surface-tint);
    color: var(--otp-brand);
}

.otp-modal .otp-modal-close:focus-visible {
    outline: 2px solid var(--otp-brand);
    outline-offset: 2px;
}

.otp-modal .modal-body {
    display: flex;
    flex-direction: column;
    padding: 36px 36px 12px;
    text-align: center;
}

.otp-modal .modal-body > .otp-modal-icon { order: 1; }
.otp-modal .modal-body > .otp-modal-title { order: 2; }
.otp-modal .modal-body > .otp-mobile-row { order: 3; }
.otp-modal .modal-body > .otp-initial-help { order: 4; }
.otp-modal .modal-body > .otp-sent-summary { order: 5; }
.otp-modal .modal-body > .otp-code-row { order: 6; }
.otp-modal .modal-body > .otp-validation { order: 7; }
.otp-modal .modal-body > .otp-expiry-row { order: 8; }
.otp-modal .modal-body > .otp-send-row { order: 5; }

.otp-modal .modal-body > .row {
    margin-right: 0;
    margin-left: 0;
}

.otp-modal-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    place-items: center;
    border-radius: 50%;
    background: var(--otp-surface-tint);
    color: var(--otp-brand);
}

.otp-modal-icon svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.otp-modal-title {
    margin: 0 0 26px;
    color: var(--otp-text);
    font-size: 23px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}

.otp-mobile-row {
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

.otp-mobile-row .form-group {
    margin: 0;
}

.otp-mobile-label {
    display: block;
    margin-bottom: 8px;
    padding: 0 !important;
    color: #33453b;
    font-size: 14px;
    font-weight: 600;
    text-align: left !important;
}

.otp-mobile-select {
    width: 100%;
    padding: 0 !important;
}

.otp-modal .otp-mobile-select .k-widget,
.otp-modal .otp-mobile-select .k-dropdown,
.otp-modal .otp-mobile-select .k-picker {
    width: 100% !important;
    border-radius: 8px !important;
}

.otp-modal .otp-mobile-select .k-dropdown-wrap,
.otp-modal .otp-mobile-select .k-picker-wrap {
    display: flex;
    align-items: center;
    min-height: 52px;
    border: 1px solid var(--otp-border) !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: none !important;
}

.otp-modal .otp-mobile-select .k-input {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
    height: 50px;
    padding: 0 14px;
    background: transparent !important;
    color: #26382e !important;
    font-size: 16px;
    font-weight: 600;
    line-height: normal;
}

.otp-modal .otp-mobile-select .k-select {
    position: static;
    display: flex;
    flex: 0 0 50px;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    width: 50px;
    height: auto;
    border-left: 1px solid var(--otp-border);
    border-radius: 0 7px 7px 0;
    background: var(--otp-surface-tint) !important;
    color: var(--otp-brand);
}

.otp-modal .otp-mobile-select .k-select .k-icon {
    position: static;
    margin: 0;
}

.otp-modal .otp-mobile-select .k-dropdown-wrap:hover,
.otp-modal .otp-mobile-select .k-dropdown-wrap.k-state-focused {
    border-color: var(--otp-brand-active) !important;
}

.otp-modal .otp-mobile-select .k-dropdown-wrap.k-state-focused {
    box-shadow: 0 0 0 3px rgba(23, 107, 60, .18) !important;
}

.otp-modal .otp-mobile-select .k-picker {
    box-sizing: border-box;
    display: flex;
    align-items: stretch;
    height: 52px;
    min-height: 52px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--otp-border) !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #26382e !important;
    box-shadow: none !important;
}

.otp-modal .otp-mobile-select .k-picker:hover,
.otp-modal .otp-mobile-select .k-picker.k-hover,
.otp-modal .otp-mobile-select .k-picker.k-focus,
.otp-modal .otp-mobile-select .k-picker:focus-within {
    border-color: var(--otp-brand-active) !important;
    background: #fff !important;
    color: #26382e !important;
}

.otp-modal .otp-mobile-select .k-picker .k-input-inner {
    box-sizing: border-box;
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
    height: 100%;
    padding: 0 14px;
    background: #fff !important;
    color: #26382e !important;
}

.otp-modal .otp-mobile-select .k-picker .k-input-value-text {
    color: #26382e !important;
}

.otp-modal .otp-mobile-select .k-picker .k-input-button {
    box-sizing: border-box;
    display: flex;
    flex: 0 0 50px;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    width: 50px;
    height: 100% !important;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-left: 1px solid var(--otp-border) !important;
    border-radius: 0 7px 7px 0 !important;
    background: var(--otp-surface-tint) !important;
    color: var(--otp-brand) !important;
    box-shadow: none !important;
}

.otp-modal .otp-mobile-select .k-picker .k-input-button:hover,
.otp-modal .otp-mobile-select .k-picker .k-input-button:focus {
    background: var(--otp-surface-tint) !important;
    color: var(--otp-brand) !important;
}

#ddlMobile-list,
#ddlMobileSubContract-list {
    overflow: hidden;
    border: 1px solid #d3ded6 !important;
    border-radius: 8px;
    background: #fff !important;
    box-shadow: 0 8px 20px rgba(22, 38, 29, .12) !important;
}

#ddlMobile-list .k-item,
#ddlMobile-list .k-list-item,
#ddlMobileSubContract-list .k-item,
#ddlMobileSubContract-list .k-list-item {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 14px;
    border: 0 !important;
    background: #fff !important;
    color: #26382e !important;
    font-size: 15px;
    font-weight: 600;
    box-shadow: none !important;
}

#ddlMobile-list .k-item.k-state-selected,
#ddlMobile-list .k-item.k-state-hover,
#ddlMobile-list .k-list-item.k-selected,
#ddlMobile-list .k-list-item.k-hover,
#ddlMobile-list .k-list-item:hover,
#ddlMobileSubContract-list .k-item.k-state-selected,
#ddlMobileSubContract-list .k-item.k-state-hover,
#ddlMobileSubContract-list .k-list-item.k-selected,
#ddlMobileSubContract-list .k-list-item.k-hover,
#ddlMobileSubContract-list .k-list-item:hover {
    background: #f3faf6 !important;
    color: #00341a !important;
}

.otp-initial-help {
    margin-top: 12px;
    color: #5c6c62;
    font-size: 14px;
    line-height: 1.5;
}

.otp-sent-summary,
.otp-code-row,
.otp-expiry-row {
    display: none;
}

.otp-sent-summary {
    width: 100%;
    margin: 0 auto;
    padding: 16px;
    border-radius: 14px;
    background: var(--otp-surface-tint);
    color: #33453b;
    text-align: center;
}

.otp-sent-instruction {
    margin: 0 0 4px;
    color: #465a4e;
    font-size: 14px;
    line-height: 1.5;
}

.otp-recipient-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 28px;
}

.otp-recipient-number {
    color: #203b2b;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .02em;
}

.otp-change-phone {
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: #176b3c;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.otp-change-phone:hover,
.otp-change-phone:focus-visible {
    color: #00341a;
    outline: 2px solid rgba(0, 77, 38, .28);
    outline-offset: 3px;
}

.otp-change-phone:disabled {
    cursor: not-allowed;
    color: #859187;
    opacity: .72;
    text-decoration: none;
}

.otp-reference {
    display: block;
    margin-top: 6px;
    color: #68776d;
    font-size: 12px;
    font-weight: 500;
}

.otp-code-row {
    width: 100%;
    margin-top: 28px;
    padding: 0 !important;
}

.otp-code-row .form-group {
    margin: 0;
}

.otp-code-field {
    width: 100%;
    padding: 0 !important;
}

.otp-input-group {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.otp-modal .otp-input-group .otp-input {
    box-sizing: border-box;
    flex: 0 1 48px;
    width: 48px !important;
    min-width: 0;
    max-width: 48px;
    height: 52px;
    padding: 0;
    border: 1px solid var(--otp-border) !important;
    border-radius: 11px !important;
    background: #fff !important;
    background-image: none !important;
    color: var(--otp-text) !important;
    text-align: center;
    font-size: 23px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

.otp-modal .otp-input-group .otp-input:not(:disabled):hover {
    border-color: #84b58f !important;
}

.otp-modal .otp-input-group .otp-input:focus,
.otp-modal .otp-input-group .otp-input:focus-visible,
.otp-modal .otp-input-group .otp-input.k-focus,
.otp-modal .otp-input-group .otp-input.k-state-focused {
    border-color: var(--otp-brand-active) !important;
    outline: none !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(23, 107, 60, .18) !important;
    caret-color: var(--otp-brand-active);
    transform: translateY(-1px);
}

.otp-modal .otp-input-group .otp-input:disabled {
    cursor: not-allowed;
    border-color: #e3e9e5 !important;
    background: #f5f7f5 !important;
    color: #96a39a !important;
    box-shadow: none !important;
    opacity: 1;
}

.otp-validation {
    position: relative;
    display: block;
    margin: 14px 0 0;
    padding: 10px 12px 10px 40px;
    border: 1px solid #f0caca;
    border-left: 4px solid #d94a45;
    border-radius: 9px;
    background: #fff4f3;
    color: #9d2925;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    text-align: left;
}

.otp-validation:empty { display: none; }
.otp-modal .modal-body > .otp-validation { width: 100%; }

.otp-validation:not(:empty)::before {
    position: absolute;
    top: 10px;
    left: 12px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #d94a45;
    color: #fff;
    content: "!";
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.otp-alert-detail {
    display: block;
    margin-top: 2px;
    font-weight: 600;
}

.otp-expiry-row {
    margin-top: 16px;
    color: #5c6c62;
    text-align: center;
}

.otp-expiry-countdown {
    color: #465a4e;
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.otp-modal .otp-send-row {
    margin-top: 18px;
    text-align: center;
}

.otp-modal .btn-send-otp {
    width: 100%;
    min-height: 50px;
    padding: 10px 18px;
    border: 1px solid var(--otp-brand) !important;
    border-radius: 12px;
    background: var(--otp-brand) !important;
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(0, 52, 26, .16);
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.otp-modal .btn-send-otp:hover,
.otp-modal .btn-send-otp:focus-visible {
    border-color: var(--otp-brand-hover) !important;
    background: var(--otp-brand-hover) !important;
    box-shadow: 0 8px 20px rgba(0, 52, 26, .2);
    transform: translateY(-1px);
}

.otp-modal .btn-send-otp:active {
    transform: translateY(0);
}

.otp-modal .btn-send-otp:disabled {
    cursor: not-allowed;
}

.otp-modal.otp-sent .modal-body > .otp-mobile-row,
.otp-modal.otp-sent .modal-body > .otp-initial-help {
    display: none !important;
}

.otp-modal.otp-sent .modal-body > .otp-sent-summary {
    display: block;
    order: 3;
    animation: otp-step-in .22s ease both;
}

.otp-modal.otp-sent .modal-body > .otp-code-row {
    display: block;
    order: 4;
    animation: otp-step-in .26s ease both;
}

.otp-modal.otp-sent .modal-body > .otp-validation {
    order: 5;
}

.otp-modal.otp-sent .modal-body > .otp-expiry-row {
    display: block;
    order: 6;
    animation: otp-step-in .3s ease both;
}

.otp-modal.otp-sent .modal-body > .otp-send-row {
    order: 7;
    margin-top: 2px;
}

.otp-modal.otp-sent .btn-send-otp {
    width: auto;
    min-height: 36px;
    padding: 4px 8px;
    border: 0 !important;
    background: transparent !important;
    color: #176b3c !important;
    font-size: 14px;
    font-weight: 600;
    box-shadow: none;
}

.otp-modal.otp-sent .btn-send-otp:hover,
.otp-modal.otp-sent .btn-send-otp:focus-visible {
    border: 0 !important;
    background: var(--otp-surface-tint) !important;
    color: var(--otp-brand) !important;
    box-shadow: none;
    transform: none;
}

.otp-modal.otp-sent .btn-send-otp:disabled {
    background: transparent !important;
    color: #77857b !important;
    opacity: 1;
}

.otp-modal.otp-sent .btn-send-otp .otp-button-loader {
    border-color: rgba(23, 107, 60, .24);
    border-top-color: #176b3c;
}

/* account-login.css has legacy .Login OTP button rules with !important sizing. */
.Login .otp-modal.otp-sent .btn-send-otp,
.Login .otp-modal.otp-sent .btn-send-otp:not(:disabled),
.Login .otp-modal.otp-sent .btn-send-otp:disabled {
    width: auto !important;
    min-width: 0 !important;
    min-height: 36px !important;
    height: auto !important;
    padding: 4px 8px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: #176b3c !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

.Login .otp-modal.otp-sent .btn-send-otp:not(:disabled):hover,
.Login .otp-modal.otp-sent .btn-send-otp:not(:disabled):focus,
.Login .otp-modal.otp-sent .btn-send-otp:not(:disabled):focus-visible {
    border: 0 !important;
    background: var(--otp-surface-tint) !important;
    color: var(--otp-brand) !important;
    box-shadow: none !important;
    transform: none;
}

.Login .otp-modal.otp-sent .btn-send-otp:disabled {
    background: transparent !important;
    color: #77857b !important;
    opacity: 1;
}

.otp-modal .modal-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 36px 30px !important;
    border: 0;
    text-align: center;
}

.otp-modal .otp-confirm-button {
    display: none;
    width: 100% !important;
    min-height: 50px;
    margin: 0 !important;
    border: 1px solid var(--otp-brand) !important;
    border-radius: 12px;
    background: var(--otp-brand) !important;
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(0, 52, 26, .16);
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.otp-modal.otp-sent .otp-confirm-button {
    display: block;
}

.Login .otp-modal.otp-sent .otp-confirm-button:not(:disabled) {
    min-height: 50px !important;
    height: 50px !important;
    border-radius: 12px !important;
    font-size: 15px !important;
}

.otp-modal .otp-confirm-button:not(:disabled):hover,
.otp-modal .otp-confirm-button:not(:disabled):focus-visible {
    border-color: var(--otp-brand-hover) !important;
    background: var(--otp-brand-hover) !important;
    box-shadow: 0 8px 20px rgba(0, 52, 26, .2);
    transform: translateY(-1px);
}

.Login .otp-modal.otp-sent .otp-confirm-button:not(:disabled):hover,
.Login .otp-modal.otp-sent .otp-confirm-button:not(:disabled):focus,
.Login .otp-modal.otp-sent .otp-confirm-button:not(:disabled):focus-visible {
    border-color: var(--otp-brand-hover) !important;
    background: var(--otp-brand-hover) !important;
    box-shadow: 0 8px 20px rgba(0, 52, 26, .2) !important;
    transform: translateY(-1px);
}

.otp-modal .otp-confirm-button:disabled {
    cursor: not-allowed;
    border-color: #dce4de !important;
    background: #e9eeea !important;
    color: #79867d !important;
    box-shadow: none;
    opacity: 1;
}

.otp-modal .otp-cancel-button {
    width: auto !important;
    min-height: 38px;
    margin: 0 !important;
    padding: 6px 14px;
    border: 0 !important;
    border-radius: 8px;
    background: transparent !important;
    color: #536259 !important;
    font-size: 14px;
    font-weight: 600;
    box-shadow: none !important;
}

.otp-modal .otp-cancel-button:hover,
.otp-modal .otp-cancel-button:focus-visible {
    background: #f3f6f4 !important;
    color: #26382e !important;
    outline: 2px solid rgba(0, 77, 38, .22);
    outline-offset: 1px;
}

.otp-success-message {
    color: #176b3c;
    font-size: 14px;
    font-weight: 600;
}

.otp-success-message[hidden] { display: none !important; }

.otp-modal.otp-verified .otp-success-message:not([hidden]) {
    display: block;
    animation: otp-success-enter .22s ease both;
}

.otp-modal.otp-verified .otp-confirm-button {
    border-color: #176b3c !important;
    background: #176b3c !important;
    color: #fff !important;
}

.otp-success-check {
    display: inline-grid;
    width: 21px;
    height: 21px;
    margin-right: 6px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    animation: otp-success-check .3s cubic-bezier(.2, .9, .3, 1.3) both;
}

.otp-button-loader {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, .42);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: -2px;
    animation: otp-button-spin .7s linear infinite;
}

@keyframes otp-button-spin { to { transform: rotate(360deg); } }
@keyframes otp-step-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes otp-success-enter { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@keyframes otp-success-check { from { opacity: 0; transform: scale(.5) rotate(-16deg); } to { opacity: 1; transform: scale(1) rotate(0); } }

@media (max-width: 480px) {
    .otp-modal { padding: 10px !important; }
    .otp-modal .modal-content { max-height: calc(100vh - 20px) !important; border-radius: 20px; }
    .otp-modal .modal-body { padding: 30px 24px 10px; }
    .otp-modal .modal-footer { padding: 10px 24px 24px !important; }
    .otp-modal-title { margin-bottom: 22px; font-size: 21px; }
    .otp-input-group { gap: 6px; }
    .otp-modal .otp-input-group .otp-input {
        flex-basis: 42px;
        width: 42px !important;
        max-width: 42px;
        height: 48px;
        font-size: 22px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .otp-modal .modal-dialog,
    .otp-modal .otp-input-group .otp-input,
    .otp-modal .btn-send-otp,
    .otp-modal .otp-confirm-button {
        transition: none !important;
    }

    .otp-button-loader,
    .otp-modal.otp-sent .modal-body > .otp-sent-summary,
    .otp-modal.otp-sent .modal-body > .otp-code-row,
    .otp-modal.otp-sent .modal-body > .otp-expiry-row,
    .otp-success-check,
    .otp-modal.otp-verified .otp-success-message:not([hidden]) {
        animation: none !important;
    }
}
