/* eSewa login replica */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --esewa-green: #4CAF50;
    --esewa-green-dark: #43a047;
    --ink: #1a1a1a;
    --muted: #9e9e9e;
    --border: #e8e8e8;
    --bg: #f4f5f7;
}

html, body {
    height: 100%;
    font-family: -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #d9dbde;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

body {
    display: flex;
    justify-content: center;
    align-items: stretch;
}

/* phone-like frame on desktop, full screen on mobile */
.phone-frame {
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* ---------- header ---------- */
.esewa-header {
    position: relative;
    background: #fafbfc;
    padding: 1.15rem 1.2rem 1rem;
}
.dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(#cfd4d8 1.1px, transparent 1.1px);
    background-size: 14px 14px;
    opacity: 0.7;
    pointer-events: none;
}
.header-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: inline-flex;
    align-items: baseline;
    text-decoration: none;
    user-select: none;
}
.logo-e {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    background: var(--esewa-green);
    color: #fff;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: 800;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1;
    margin-right: -6px;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.35);
}
.logo-sewa {
    font-size: 2.6rem;
    font-weight: 700;
    color: #111;
    font-family: Georgia, 'Times New Roman', serif;
    letter-spacing: -0.02em;
}
.tm { font-size: 0.7rem; color: #666; margin-left: 2px; }
.close-btn {
    background: #fff;
    border: none;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: background 0.2s ease;
}
.close-btn:hover { background: #f2f2f2; }

/* ---------- login card ---------- */
.login-card {
    flex: 1;
    background: #fff;
    border-radius: 22px 22px 0 0;
    margin-top: -10px;
    padding: 0 1.6rem 2rem;
    display: flex;
    flex-direction: column;
}

/* tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2.4rem;
}
.tab {
    flex: 1;
    background: none;
    border: none;
    padding: 1.35rem 0 1.1rem;
    font-size: 1.18rem;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
}
.tab.active { color: var(--esewa-green); }
.tab.active::after {
    content: '';
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: -1px;
    height: 3.5px;
    border-radius: 3px;
    background: var(--esewa-green);
}

/* fields */
.field-group { margin-bottom: 1.9rem; }
.field-group label {
    display: block;
    font-size: 1.12rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 0.75rem;
}
.input-box {
    display: flex;
    align-items: center;
    background: #f6f7f8;
    border: 1.5px solid #ececec;
    border-radius: 12px;
    padding: 0.35rem 0.9rem;
    min-height: 62px;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.input-box:focus-within {
    border-color: var(--esewa-green);
    background: #fff;
}
.input-box.hidden { display: none; }
.input-box input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    color: var(--ink);
    padding: 0.6rem 0;
}
.input-box input::placeholder { color: #b3b6ba; font-weight: 500; }
input[type="tel"] { letter-spacing: 0.02em; }

/* country chip */
.country {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem 0.6rem 0.4rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
}
.np-flag { border-radius: 2px; flex-shrink: 0; }
.caret { margin-left: 2px; opacity: 0.7; }
.divider {
    width: 1.5px;
    height: 34px;
    background: #dcdde0;
    margin-right: 0.9rem;
    flex-shrink: 0;
}

/* eye toggle */
.eye-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.hidden { display: none !important; }

/* options row */
.options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 0 0.15rem;
}
.remember {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    cursor: pointer;
    user-select: none;
}
.remember input { position: absolute; opacity: 0; pointer-events: none; }
.checkmark {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 2px solid #c7c9cc;
    background: #fff;
    display: grid;
    place-items: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.remember input:checked + .checkmark {
    background: var(--esewa-green);
    border-color: var(--esewa-green);
}
.remember input:checked + .checkmark::after {
    content: '';
    width: 8px;
    height: 14px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}
.remember-text { font-size: 1.22rem; font-weight: 700; color: #222; }
.forgot {
    font-size: 1.22rem;
    font-weight: 800;
    color: #1a1a1a;
    text-decoration: none;
}
.forgot:hover { color: var(--esewa-green); }

/* login button */
.login-btn {
    width: 100%;
    min-height: 64px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(180deg, #4fc444, #3ea832);
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(62, 168, 50, 0.35);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.login-btn:hover { filter: brightness(1.04); }
.login-btn:active { transform: scale(0.985); box-shadow: 0 3px 8px rgba(62, 168, 50, 0.3); }

/* register */
.register-row {
    margin-top: auto;
    padding-top: 4.5rem;
    text-align: center;
}
.register-row a {
    color: var(--esewa-green);
    font-size: 1.35rem;
    font-weight: 800;
    text-decoration: none;
}
.register-row a:hover { text-decoration: underline; }

/* small phones */
@media (max-height: 700px) {
    .register-row { padding-top: 2.5rem; }
    .field-group { margin-bottom: 1.4rem; }
    .tabs { margin-bottom: 1.6rem; }
}

/* ---------- OTP page ---------- */
.otp-card { padding-top: 2.2rem; }
.otp-title {
    font-size: 1.9rem;
    font-weight: 800;
    text-align: center;
    color: #1a1a1a;
    margin-bottom: 0.6rem;
}
.otp-sub {
    text-align: center;
    font-size: 1.08rem;
    color: #777;
    margin-bottom: 2.4rem;
    line-height: 1.45;
}
.otp-boxes {
    display: flex;
    gap: 0.55rem;
    justify-content: center;
    margin-bottom: 1.4rem;
}
.otp-digit {
    width: 48px;
    height: 58px;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    background: #f6f7f8;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.otp-digit:focus {
    border-color: var(--esewa-green);
    background: #fff;
}
.otp-error {
    text-align: center;
    color: #e53935;
    font-size: 1.02rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.otp-attempts {
    text-align: center;
    color: #ff9800;
    font-size: 0.98rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.otp-timer-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 2rem;
    font-size: 1.08rem;
    color: #666;
}
.otp-timer {
    font-weight: 800;
    color: var(--esewa-green);
    font-variant-numeric: tabular-nums;
}
.otp-timer.expired { color: #e53935; }
.shake { animation: shake 0.4s ease; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* ---------- Success page ---------- */
.success-card {
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 3rem;
}
.success-icon { margin-bottom: 1.6rem; }
.success-title {
    font-size: 1.9rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 0.9rem;
}
.success-msg {
    font-size: 1.18rem;
    color: #444;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}
.success-wait {
    font-size: 1.08rem;
    color: #888;
    margin-bottom: 2.8rem;
    line-height: 1.5;
}
.success-card .login-btn { max-width: 320px; }
