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

.lka-wrap {
    --lka-primary: #6b5c20;
    --lka-primary-dark: #524616;
    --lka-gold: #f1c40f;
    --lka-bg: #f4f2eb;
    --lka-text: #212121;
    --lka-muted: #666666;
    --lka-danger: #d93025;
    --lka-success: #1e8e3e;
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--lka-text);
    line-height: 1.55;
    background: var(--lka-bg);
    padding: 0;
    margin: 0;
}

.lka-wrap *, .lka-wrap *::before, .lka-wrap *::after {
    box-sizing: border-box;
}

.lka-gate-wrapper {
    min-height: 76vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 16px;
    position: relative;
    background: radial-gradient(circle at center, #2b2512 0%, #0b0b0c 72%);
    border-radius: 8px;
    overflow: hidden;
}

.lka-gate-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../images/lka-crest.svg') center center / min(62vmin, 480px) no-repeat;
    opacity: 0.22;
    filter: blur(2px);
    pointer-events: none;
}

.lka-gate-card, .lka-status-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 540px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    padding: 36px 32px 28px;
    border-top: 5px solid var(--lka-primary);
}

.lka-status-card {
    text-align: center;
}

.lka-gate-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.lka-gate-brand img {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
}

.lka-gate-brand h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    color: var(--lka-text);
}

.lka-gate-brand p {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--lka-muted);
}

.lka-gate-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 22px;
    color: var(--lka-text);
}

.lka-passcode-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #d5d5d5;
}

.lka-passcode-input-wrap:focus-within {
    border-bottom-color: var(--lka-primary);
}

.lka-passcode-input-wrap input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 20px;
    letter-spacing: 4px;
    padding: 10px 40px 10px 4px;
    font-family: inherit;
    color: var(--lka-text);
    background: transparent;
}

.lka-passcode-input-wrap input::placeholder {
    letter-spacing: normal;
    font-size: 16px;
    color: #999;
}

.lka-toggle-eye-btn {
    position: absolute;
    right: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #555;
    display: flex;
    align-items: center;
}

.lka-gate-hint {
    font-size: 13px;
    color: var(--lka-danger);
    margin: 8px 0 0;
    min-height: 20px;
}

.lka-gate-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 22px;
    gap: 12px;
}

.lka-btn-enter {
    background: var(--lka-gold);
    color: #1a1a1a;
    border: none;
    padding: 10px 26px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.8px;
    border-radius: 4px;
    cursor: pointer;
}

.lka-record-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f5f2e6;
    color: var(--lka-primary);
    border: 1px solid #dfd6b3;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.lka-status-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 16px;
}

.lka-status-icon.success { background: #e6f4ea; color: var(--lka-success); }
.lka-status-icon.expired { background: #fce8e6; color: var(--lka-danger); }

.lka-form-hero {
    background: linear-gradient(135deg, #1b1912 0%, #3a3213 55%, #161616 100%);
    color: #ffffff;
    padding: 36px 20px 44px;
    text-align: center;
    border-bottom: 5px solid var(--lka-gold);
}

.lka-form-hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.lka-form-hero-logo {
    width: 78px;
    height: 78px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: block;
}

.lka-form-hero h1 {
    margin: 0 0 6px;
    font-size: clamp(22px, 4vw, 30px);
    font-weight: 800;
    color: #ffffff;
}

.lka-subtitle {
    margin: 0 0 18px;
    font-size: 15px;
    color: #e6dfb8;
    font-weight: 600;
}

.lka-hero-meta-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.lka-hero-badge {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(241, 196, 15, 0.45);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
}

.lka-hero-badge.record-highlight {
    background: var(--lka-gold);
    color: #161616;
    border-color: var(--lka-gold);
}

.lka-form-shell {
    max-width: 820px;
    margin: -18px auto 32px;
    padding: 0 14px 36px;
    position: relative;
    z-index: 3;
}

.lka-section-banner {
    background: #ffffff;
    border-left: 6px solid var(--lka-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 18px 22px;
    margin: 24px 0 14px;
    border-radius: 4px;
}

.lka-section-banner h3 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 800;
    color: var(--lka-primary);
}

.lka-section-banner p {
    margin: 0;
    font-size: 15px;
    color: var(--lka-muted);
    font-weight: 600;
}

.lka-q-card {
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    margin-bottom: 18px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.lka-q-card.has-error {
    outline: 2px solid var(--lka-danger);
}

.lka-q-header {
    background: var(--lka-primary);
    color: #ffffff;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 700;
}

.lka-q-sublabel {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 400;
    color: #f4efd8;
}

.lka-q-body {
    padding: 18px 20px 16px;
}

.lka-q-input, .lka-q-select, .lka-q-textarea {
    width: 100%;
    border: none;
    border-bottom: 2px solid #dcdcdc;
    padding: 8px 4px;
    font-size: 16px;
    font-family: inherit;
    color: var(--lka-text);
    background: transparent;
    outline: none;
}

.lka-q-input:focus, .lka-q-select:focus, .lka-q-textarea:focus {
    border-bottom-color: var(--lka-primary);
}

.lka-q-select {
    background: #fafafa;
    padding: 10px 8px;
}

.lka-checkbox-row {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
    padding: 6px 0;
}

.lka-checkbox-row input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--lka-primary);
}

.lka-other-input {
    margin-top: 10px;
    font-size: 15px;
}

.lka-q-footer {
    margin-top: 12px;
}

.lka-required-badge {
    background: #e8e8e8;
    color: #333;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 3px;
}

.lka-field-error-msg {
    color: var(--lka-danger);
    font-size: 13px;
    font-weight: 700;
    margin-top: 6px;
}

.lka-upload-box {
    border: 2px dashed #c8c1a4;
    background: #fbfaf5;
    border-radius: 6px;
    padding: 18px;
    text-align: center;
}

.lka-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--lka-primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
}

.lka-upload-input-hidden {
    display: none;
}

.lka-upload-meta {
    font-size: 13px;
    color: var(--lka-muted);
    margin-top: 8px;
}

.lka-upload-preview {
    margin-top: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
}

.lka-upload-preview img {
    max-height: 110px;
    max-width: 100%;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.lka-file-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--lka-success);
}

.lka-submit-bar {
    background: #ffffff;
    padding: 22px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 24px;
}

.lka-btn-submit-form {
    background: var(--lka-primary);
    color: #ffffff;
    border: none;
    padding: 14px 36px;
    font-size: 17px;
    font-weight: 800;
    border-radius: 6px;
    cursor: pointer;
}

.lka-alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
}

.lka-alert-danger {
    background: #fce8e6;
    color: #c5221f;
    border: 1px solid #f5c2be;
}

/* Admin Panel Helpers */
.lka-admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.lka-admin-stat {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-left: 5px solid #6b5c20;
    border-radius: 6px;
    padding: 16px;
}

.lka-admin-stat.green { border-left-color: #1e8e3e; }
.lka-admin-stat.orange { border-left-color: #e37400; }
.lka-admin-stat.gray { border-left-color: #6c757d; }

.lka-admin-stat .lbl {
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
}

.lka-admin-stat .val {
    font-size: 28px;
    font-weight: 800;
    margin-top: 4px;
    color: #1d2327;
}

.lka-admin-card {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    padding: 18px;
    margin-bottom: 18px;
}

.lka-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.lka-badge-unused { background: #eef0f3; color: #495057; }
.lka-badge-logged_in { background: #fff3cd; color: #996404; }
.lka-badge-submitted { background: #e6f4ea; color: #137333; }

@media (max-width: 640px) {
    .lka-gate-card, .lka-status-card { padding: 26px 18px 22px; }
    .lka-submit-bar { flex-direction: column; align-items: stretch; text-align: center; }
    .lka-btn-submit-form { width: 100%; }
}
