/* =========================================================
   Shree Samarth Sahakari Bank — e-KYC Portal
   Refined institutional palette:
   wine maroon · champagne accent · cool stone neutrals
   ========================================================= */

:root {
    --brand: #6e2431;
    --brand-deep: #4a1822;
    --brand-mid: #8a3444;
    --brand-soft: #f3e8ea;
    --brand-wash: #faf7f6;
    --accent: #b08d57;
    --accent-soft: #f3eadc;
    --ink: #1f1c1b;
    --muted: #6f6a66;
    --line: #e6e0db;
    --line-strong: #d4cdc6;
    --surface: #f0eeeb;
    --panel: #ffffff;
    --success: #216b4a;
    --success-bg: #e7f4ee;
    --danger: #9a2b2b;
    --danger-bg: #f9ecec;
    --warning-bg: #f8f1e4;
    --warning-ink: #6e5624;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 12px 32px rgba(31, 28, 27, 0.07);
    --shadow-sm: 0 2px 10px rgba(31, 28, 27, 0.05);
    --font: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font);
    background:
        linear-gradient(180deg, #f7f5f2 0%, var(--surface) 42%, #ebe8e4 100%);
    color: var(--ink);
    line-height: 1.55;
    min-height: 100vh;
    padding: 1.25rem 1rem 2rem;
}

a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    color: var(--brand-deep);
    text-decoration: underline;
}

/* ----- Header ----- */
header {
    background: linear-gradient(120deg, var(--brand-deep) 0%, var(--brand) 70%, #7d2d3c 100%);
    color: #fff;
    padding: 1.2rem 1.5rem 1.05rem;
    border-radius: var(--radius);
    margin: 0 auto 1.35rem;
    max-width: 1120px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, #d4b88a 50%, var(--accent) 100%);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
    flex-wrap: wrap;
}

header .logo {
    height: 66px;
    width: 66px;
    object-fit: contain;
    border-radius: 16px;
    background: #fff;
    padding: 5px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.header-text {
    text-align: left;
}

.header-text h1 {
    margin: 0;
    font-size: clamp(1.08rem, 2.4vw, 1.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

header .highlight {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--brand-deep);
    background: var(--accent-soft);
    border: 1px solid rgba(176, 141, 87, 0.35);
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
}

.top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    align-items: center;
    margin-top: 0.95rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.top-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.38rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: background 0.15s ease, transform 0.15s ease;
}

.top-nav a:hover {
    background: rgba(255, 255, 255, 0.2);
    text-decoration: none;
    transform: translateY(-1px);
}

.nav-user {
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.35rem 0.7rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 999px;
}

/* ----- Main / Footer ----- */
main {
    background: var(--panel);
    padding: 1.6rem 1.6rem 1.8rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    max-width: 960px;
    margin: 0 auto;
}

footer {
    text-align: center;
    margin: 1.35rem auto 0;
    max-width: 960px;
    color: var(--muted);
    font-size: 0.78rem;
}

/* ----- Layout helpers ----- */
.container {
    max-width: 640px;
    margin: 0 auto;
}

.container.wide {
    max-width: 100%;
}

.text-center {
    text-align: center;
}

.page-title {
    font-size: 1.32rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--ink);
    margin-bottom: 0.3rem;
}

.page-sub {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1.3rem;
}

.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.page-toolbar h2 {
    font-size: 1.28rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.panel {
    background: linear-gradient(180deg, #fffcfb 0%, var(--brand-wash) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.25rem;
}

/* ----- Forms ----- */
.form-group,
.form-field {
    margin-bottom: 1rem;
}

form label,
.form-group > label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--ink);
}

form input[type='text'],
form input[type='password'],
form input[type='email'],
form input[type='file'],
form select,
.form-group input,
.form-group select,
.form-field input {
    width: 100%;
    padding: 0.72rem 0.9rem;
    margin-bottom: 0;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--ink);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

form input:focus,
form select:focus,
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--brand-mid);
    box-shadow: 0 0 0 3px rgba(110, 36, 49, 0.12);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.checkbox-row input {
    width: auto;
}

.field-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.notice {
    background: var(--warning-bg);
    color: var(--warning-ink);
    border: 1px solid #e5d5b4;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.mismatch-notice {
    margin-bottom: 0;
}

.mismatch-notice p {
    margin: 0;
    line-height: 1.5;
}

.mismatch-notice p + p {
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px dashed #e5d5b4;
}

.mismatch-notice .mr-line {
    font-family: 'Nirmala UI', 'Mangal', 'Noto Sans Devanagari', var(--font);
    font-size: 0.95rem;
}

.mismatch-actions {
    margin-top: 1.1rem;
}

/* ----- Buttons ----- */
.btn,
form button.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background: var(--brand);
    color: #fff !important;
    padding: 0.68rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none !important;
    box-shadow: 0 3px 10px rgba(110, 36, 49, 0.22);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn:hover,
form button.btn:hover {
    background: var(--brand-deep);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(110, 36, 49, 0.28);
}

.btn-secondary,
form button.btn.btn-secondary,
button.btn.btn-secondary,
a.btn.btn-secondary {
    background: #fff !important;
    color: var(--brand) !important;
    border: 1.5px solid var(--line-strong);
    box-shadow: none;
}

.btn-secondary:hover,
form button.btn.btn-secondary:hover,
button.btn.btn-secondary:hover,
a.btn.btn-secondary:hover {
    background: var(--brand-soft) !important;
    color: var(--brand-deep) !important;
    box-shadow: none;
}

.btn-small {
    padding: 0.35rem 0.65rem;
    font-size: 0.74rem;
    box-shadow: none;
}

.btn-danger {
    background: var(--danger) !important;
}

.btn-danger:hover {
    background: #7f2222 !important;
}

.btn-ghost {
    background: transparent !important;
    color: var(--brand) !important;
    box-shadow: none;
    border: 1px solid var(--line-strong);
}

/* ----- Flashes ----- */
.flashes {
    list-style: none;
    padding: 0;
    margin: 0 0 1.15rem;
}

.flashes li {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.88rem;
    font-weight: 500;
    text-align: left;
}

.flashes .success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #c5e4d4;
}

.flashes .error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #efc8c8;
}

/* ----- Tables ----- */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.86rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.data-table th,
.data-table td {
    padding: 0.72rem 0.85rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
}

.data-table th {
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: var(--brand-wash);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.inline-form {
    display: inline;
    margin: 0;
}

.badge {
    display: inline-block;
    padding: 0.16rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-active {
    background: var(--success-bg);
    color: var(--success);
}

.badge-disabled {
    background: #efefef;
    color: #666;
}

.badge-admin {
    background: var(--accent-soft);
    color: #6a5228;
}

.badge-user {
    background: var(--brand-soft);
    color: var(--brand);
}

.kyc-summary {
    text-align: left;
    background: var(--success-bg);
    border: 1px solid #c5e4d4;
    border-radius: var(--radius-sm);
    padding: 0.9rem 1.05rem;
    margin: 1rem auto 0;
    max-width: 520px;
}

.kyc-summary p {
    margin: 0.2rem 0;
    font-size: 0.9rem;
    color: var(--ink);
}

.inline-open-account {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
}

.inline-open-account input[type="text"] {
    width: 8.5rem;
    padding: 0.32rem 0.5rem;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    font: inherit;
    font-size: 0.8rem;
}

/* ----- Success / empty states ----- */
.success-card {
    text-align: center;
    padding: 0.5rem 0 0.25rem;
}

.success-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--success-bg);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    font-weight: 700;
}

.path-box {
    background: var(--brand-wash);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;
    font-size: 0.84rem;
    word-break: break-all;
    color: var(--muted);
}

.pdf-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.pdf-list li {
    margin: 0.45rem 0;
}

.pdf-download-link {
    display: inline-block;
    padding: 0.45rem 0.85rem;
    background: var(--brand-soft);
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}

.upload-hint {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: -0.3rem;
    margin-bottom: 0.85rem;
}

/* ----- Offline e-KYC help ----- */
body.help-page main {
    max-width: 1100px;
}

.help-wrap {
    max-width: 100%;
}

.help-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
}

.help-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.help-pdf-frame {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    min-height: 70vh;
}

.help-pdf-frame iframe {
    display: block;
    width: 100%;
    height: min(78vh, 920px);
    border: 0;
}

.help-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.35rem;
}

.help-footnote {
    margin-top: 1.4rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
    font-size: 0.78rem;
    color: var(--muted);
}

.login-links {
    text-align: center;
    margin-top: 1rem;
}

.login-links a {
    color: var(--brand);
    font-weight: 600;
}

.remember-row {
    margin-bottom: 0.75rem;
}

.remember-label {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    color: var(--muted);
}

@media (max-width: 768px) {
    body {
        padding: 0.75rem 0.65rem 1.5rem;
    }

    .logo-container {
        flex-direction: column;
        text-align: center;
    }

    .header-text {
        text-align: center;
    }

    header .logo {
        height: 58px;
        width: 58px;
    }

    main {
        padding: 1.15rem;
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }
}
