@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --bg-top: #edf9f3;
    --bg-bottom: #eef6ff;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --border: rgba(16, 34, 70, 0.08);
    --text: #183153;
    --muted: #667085;
    --accent: #0f9f6e;
    --accent-strong: #0b6fd3;
    --accent-soft: #e8f8f2;
    --success-bg: #ecfdf3;
    --success-text: #027a48;
    --error-bg: #fef3f2;
    --error-text: #b42318;
    --shadow: 0 24px 60px rgba(18, 38, 74, 0.12);
    --phone-shadow: 0 28px 80px rgba(15, 42, 78, 0.16);
}

html, body {
    min-height: 100%;
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(15, 159, 110, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(11, 111, 211, 0.14), transparent 32%),
        linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
    color: var(--text);
}

body {
    min-height: 100vh;
}

a, .btn-link {
    color: #0b63ce;
}

h1,
h2 {
    margin: 0;
    line-height: 1.05;
}

h1 {
    font-size: clamp(2rem, 7vw, 3.1rem);
    font-weight: 700;
}

.content {
    padding: 0;
}

.mobile-shell {
    width: min(100%, 430px);
    margin: 0 auto;
    min-height: 100vh;
    padding: calc(env(safe-area-inset-top, 0px) + 1rem) 0.9rem calc(env(safe-area-inset-bottom, 0px) + 6rem);
    position: relative;
}

.companies-screen {
    font-size: 0.8em;
}

.login-shell {
    width: min(100%, 430px);
    min-height: 100vh;
    margin: 0 auto;
    padding: calc(env(safe-area-inset-top, 0px) + 1rem) 0.9rem calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
    display: grid;
    gap: 1rem;
    align-items: stretch;
    position: relative;
}

.mobile-shell::before,
.login-shell::before {
    content: "";
    position: fixed;
    inset: 12px;
    border-radius: 34px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(245, 250, 255, 0.94));
    border: 1px solid rgba(17, 111, 178, 0.08);
    box-shadow: var(--phone-shadow);
    z-index: -1;
}

.login-hero {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 1.3rem;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.24), transparent 30%),
        linear-gradient(145deg, #0f7d62, #116fb2 58%, #0d4b87);
    color: #f4fbff;
    box-shadow: 0 30px 60px rgba(12, 71, 114, 0.22);
}

.login-hero::after {
    content: "";
    position: absolute;
    inset: auto -15% -20% auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
}

.login-badge {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.84rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.login-eyebrow,
.login-hero h1,
.login-subtitle {
    color: #f4fbff;
}

.login-subtitle {
    max-width: 32rem;
    opacity: 0.92;
}

.login-feature-strip {
    display: grid;
    gap: 0.85rem;
    margin-top: 1.3rem;
}

.login-feature-card {
    padding: 1rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
}

.feature-kicker {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    letter-spacing: 0.08rem;
    text-transform: uppercase;
    color: rgba(244, 251, 255, 0.72);
}

.login-panel {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(17, 111, 178, 0.08);
}

.login-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.login-brand-block {
    display: grid;
    justify-items: center;
    gap: 0.75rem;
    width: 100%;
    text-align: center;
}

.login-brand-logo {
    width: min(100%, 220px);
    height: auto;
    object-fit: contain;
    display: block;
}

.login-brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.security-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(15, 159, 110, 0.12), rgba(11, 111, 211, 0.12));
    color: #0f6d78;
    font-size: 0.85rem;
    font-weight: 700;
}

.panel {
    background: var(--surface);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 16px 36px rgba(18, 38, 74, 0.08);
    padding: 1rem;
    margin-bottom: 0.9rem;
}

.hero-panel {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 245, 235, 0.86)),
        var(--surface);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-strong);
    margin-bottom: 0.6rem;
}

.hero-subtitle {
    color: var(--muted);
    margin-top: 0.85rem;
    margin-bottom: 0;
    font-size: 1rem;
    line-height: 1.5;
}

.hero-header,
.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.company-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: center;
}

.companies-hero-copy {
    display: grid;
    gap: 0.35rem;
    width: 100%;
}

.companies-hero-copy-centered {
    justify-items: center;
    text-align: center;
}

.companies-greeting {
    font-size: 0.96rem;
    line-height: 1.2;
}

.companies-greeting-centered {
    text-align: center;
}

.companies-subtitle {
    text-align: center;
    margin-top: 0;
}

.companies-section-title {
    text-align: center;
}

.companies-logout-wrap {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.companies-logout-button {
    width: 100%;
}

.company-title-small {
    font-size: clamp(0.7rem, 2.45vw, 1.09rem);
    line-height: 1.2;
}

.mark-greeting-title {
    font-size: 0.84rem;
    line-height: 1.28;
}

.login-form,
.field-group {
    display: grid;
    gap: 0.5rem;
}

.login-form {
    gap: 1rem;
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--muted);
    font-size: 0.94rem;
    user-select: none;
}

.remember-checkbox {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent-strong);
}

.biometric-login-button {
    width: 100%;
}

.terms-screen {
    font-size: 0.92rem;
}

.terms-title {
    font-size: 1.35rem;
    line-height: 1.18;
}

.terms-panel {
    display: grid;
    gap: 0.75rem;
}

.terms-panel h2 {
    font-size: 1rem;
}

.terms-panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.48;
}

.terms-accept-row {
    align-items: flex-start;
}

.terms-secondary-button {
    width: 100%;
}

label {
    font-weight: 600;
    color: var(--text);
}

.custom-input {
    min-height: 3.35rem;
    border-radius: 18px;
    border: 1px solid rgba(24, 49, 83, 0.12);
    background: rgba(255, 255, 255, 0.88);
    padding: 0.95rem 1rem;
    font-size: 0.98rem;
}

.login-input {
    min-height: 3.5rem;
    border-radius: 20px;
    background: linear-gradient(180deg, #fbfdff, #f5f9fd);
}

.custom-input:focus,
.action-button:focus,
.ghost-button:focus,
.secondary-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 122, 24, 0.2);
    border-color: rgba(15, 159, 110, 0.4);
}

.action-button,
.ghost-button,
.secondary-button {
    border: 0;
    border-radius: 999px;
    min-height: 3.1rem;
    padding: 0.9rem 1.2rem;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.action-button {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff;
    box-shadow: 0 16px 32px rgba(17, 111, 178, 0.22);
}

.login-button {
    min-height: 3.5rem;
    margin-top: 0.35rem;
    font-size: 1rem;
}

.ghost-button,
.secondary-button {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.action-button:hover,
.ghost-button:hover,
.secondary-button:hover {
    transform: translateY(-1px);
}

.action-button:disabled {
    opacity: 0.7;
    transform: none;
}

.summary-grid,
.details-grid {
    display: grid;
    gap: 0.8rem;
}

.company-list {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.attendance-list {
    display: grid;
    gap: 0.9rem;
    margin-top: 1rem;
}

.mark-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.mode-card {
    display: grid;
    gap: 0.35rem;
    width: 100%;
    text-align: left;
    padding: 1rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.mode-card span {
    color: var(--muted);
    font-size: 0.92rem;
}

.mode-card-active {
    border-color: rgba(15, 159, 110, 0.85);
    box-shadow: 0 14px 32px rgba(15, 159, 110, 0.22);
    background: linear-gradient(135deg, rgba(15, 159, 110, 0.16), rgba(11, 111, 211, 0.14));
    color: #0f5f63;
}

.mode-card-active strong {
    color: #064e3b;
}

.bottom-nav {
    position: sticky;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 0.75rem);
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.25rem;
    align-items: center;
    margin-top: 1rem;
    padding: 0.45rem;
    border: 1px solid rgba(16, 34, 70, 0.08);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 32px rgba(18, 38, 74, 0.12);
    backdrop-filter: blur(16px);
}

.bottom-nav-item {
    display: grid;
    justify-items: center;
    gap: 0.25rem;
    min-width: 0;
    min-height: 3.1rem;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.bottom-nav-item svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
}

.bottom-nav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bottom-nav-item-active {
    color: var(--accent-strong);
    background: linear-gradient(180deg, #ffffff, #eef7ff);
}

.attendance-card {
    display: grid;
    gap: 0.9rem;
    padding: 0.95rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
}

.history-subtitle {
    margin-top: 0.25rem;
    font-size: 0.86rem;
}

.history-table-wrap {
    margin-top: 1rem;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
}

.history-table {
    width: 100%;
    min-width: 360px;
    border-collapse: collapse;
    font-size: 0.74rem;
}

.history-table th,
.history-table td {
    padding: 0.58rem 0.36rem;
    border-bottom: 1px solid rgba(16, 34, 70, 0.07);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.history-col-date,
.history-col-time {
    width: 1%;
}

.history-col-status {
    min-width: 86px;
}

.history-table th {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.history-table td {
    color: var(--text);
}

.history-status {
    display: inline-block;
    min-width: 72px;
    text-align: center;
    padding: 0.32rem 0.5rem;
    border-radius: 999px;
    background: var(--success-bg);
    color: var(--success-text);
    font-size: 0.78rem;
    font-weight: 700;
}

.history-status-pending {
    background: var(--error-bg);
    color: var(--error-text);
}

.attendance-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.attendance-card-header strong {
    color: var(--text);
}

.attendance-card-header span {
    color: var(--muted);
    font-size: 0.9rem;
}

.attendance-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.company-card {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 0.9rem;
    align-items: center;
    width: 100%;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    padding: 0.85rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.company-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(18, 38, 74, 0.12);
    border-color: rgba(255, 122, 24, 0.35);
}

.company-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--border);
    padding: 0.35rem;
}

.hero-logo {
    width: 80px;
    height: 80px;
}

.company-detail-logo {
    width: 48px;
    height: 48px;
}

.placeholder-logo {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.company-info {
    display: grid;
    gap: 0.35rem;
}

.company-info strong {
    color: var(--text);
    font-size: 0.8rem;
}

.last-mark-title {
    font-size: 0.96rem;
}

.company-info span,
.token-line {
    color: var(--muted);
    word-break: break-all;
}

.summary-grid {
    margin-top: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-card,
.detail-item {
    background: var(--surface-strong);
    border-radius: 18px;
    border: 1px solid var(--border);
    padding: 0.9rem;
}

.summary-card span,
.detail-item span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    margin-bottom: 0.35rem;
}

.summary-card strong,
.detail-item strong {
    color: var(--text);
    word-break: break-word;
}

.qr-wrapper {
    display: grid;
    justify-items: center;
    gap: 0.75rem;
    padding-top: 0.75rem;
}

.qr-image {
    width: min(100%, 280px);
    border-radius: 24px;
    background: #fff;
    padding: 0.75rem;
    border: 1px solid var(--border);
}

.status-box {
    display: grid;
    gap: 0.25rem;
    border-radius: 18px;
    padding: 0.9rem 1rem;
    margin-top: 1rem;
}

.compact-box {
    margin-top: 0;
}

.success-box {
    background: var(--success-bg);
    color: var(--success-text);
}

.error-box {
    background: var(--error-bg);
    color: var(--error-text);
}

.map-link {
    display: inline-block;
    margin-top: 0.9rem;
    font-weight: 600;
}

.payload-box {
    margin-top: 1rem;
    background: #132238;
    color: #f8fbff;
    border-radius: 18px;
    padding: 1rem;
    overflow: auto;
}

.payload-title,
.helper-text {
    color: var(--muted);
    margin-bottom: 0.5rem;
}

pre {
    margin: 0;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.validation-message {
    color: var(--error-text);
    font-size: 0.9rem;
}

.blazor-error-boundary {
    background: #b42318;
    padding: 1rem;
    color: white;
    border-radius: 16px;
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

@media (min-width: 768px) {
    .mobile-shell {
        width: min(100%, 430px);
    }

    .login-shell {
        width: min(100%, 430px);
        grid-template-columns: 1fr;
    }

    .login-hero,
    .login-panel {
        padding: 1.35rem;
    }

    .login-brand-logo {
        width: min(100%, 240px);
    }

    .login-feature-strip {
        grid-template-columns: 1fr;
    }

    .details-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
