/* Workflow Page — MFP Embedded Chromium */

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

html {
    height: 100%;
    overflow: hidden;
    background: #e4e4e4 url('/images/bg-panel.png?v=4') 0 0/100% 100% no-repeat;
    border: 0;
    outline: 0;
}

body {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: transparent;
    color: #333;
    margin: 0;
    padding: 0;
    border: 0;
}

/* Full-page layout */
.wf-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

/* Header */
.wf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px 12px;
    flex-shrink: 0;
    position: relative;
}

.wf-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    height: 2px;
    background: #999;
}

.wf-logo {
    height: 57px;
    width: auto;
}

.wf-title-img {
    height: 40px;
    width: auto;
}

/* Body / Grid area */
.wf-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 48px;
    position: relative;
    min-height: 0;
}

.wf-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 12px 24px;
    max-width: 740px;
    width: 100%;
}

.wf-grid-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.wf-grid-btn:active {
    transform: scale(0.95);
}

.wf-grid-btn.wf-faded {
    opacity: 0.2;
    pointer-events: none;
}

/* Workflow button icon container */
.wf-icon-wrap {
    width: 132px;
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wf-grid-icon {
    width: auto;
    max-height: 86px;
    max-width: 132px;
    object-fit: contain;
}

.wf-grid-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1.25;
    max-width: 160px;
    word-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wf-grid-spacer {
    /* Maintains grid layout when fewer than 6 workflows */
}

/* Loading & Empty states */
.wf-loading {
    text-align: center;
    color: #666;
    font-size: 1rem;
    padding: 40px 20px;
}

.wf-empty {
    text-align: center;
    padding: 40px 20px;
    max-width: 400px;
}

.wf-empty-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.wf-empty-sub {
    font-size: 1rem;
    color: #777;
    line-height: 1.5;
}

/* Footer */
.wf-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    flex-shrink: 0;
    font-size: 1.3rem;
    color: #333;
    position: relative;
}

.wf-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 2px;
    background: #999;
}

.wf-footer-user {
    font-size: 0.72rem;
}

.wf-footer-user strong {
    color: #000;
}

.wf-footer-label {
    font-weight: 700;
    color: #111;
    font-size: 1.35rem;
}

/* Overlay */
.wf-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.4);
    text-align: center;
}

.wf-overlay-panel {
    display: inline-block;
    text-align: left;
    margin-top: 15%;
    background: rgba(55, 155, 185, 0.93);
    border-radius: 16px;
    padding: 24px 32px;
    min-width: 260px;
    max-width: 320px;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* Duplex selection */
.wf-duplex-option {
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
    font-size: 1.05rem;
    opacity: 0.65;
    -webkit-tap-highlight-color: transparent;
}

.wf-duplex-option:hover {
    background: rgba(255, 255, 255, 0.12);
}

.wf-duplex-option.wf-selected {
    opacity: 1;
    font-weight: 700;
}

.wf-overlay-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.wf-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.wf-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.wf-btn-cancel {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.wf-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.3);
}

.wf-btn-scan {
    background: #28a745;
    color: #fff;
}

.wf-btn-scan:hover:not(:disabled) {
    background: #34c759;
}

/* Scanning state */
.wf-scanning {
    text-align: center;
    padding: 20px 0;
}

.wf-scanning-text {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.wf-scanning-sub {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Uploading state */
.wf-uploading {
    text-align: center;
    padding: 20px 0;
}

.wf-uploading-text {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.wf-uploading-sub {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Success state */
.wf-success {
    text-align: center;
    padding: 16px 0;
}

.wf-success-text {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.5;
}

/* Carousel buttons */
.wf-carousel-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    width: 44px;
    height: 44px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, box-shadow 0.15s;
}

.wf-carousel-btn:hover {
    background: #f0f0f0;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}

.wf-carousel-btn:active {
    background: #e0e0e0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.wf-carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    box-shadow: none;
}

.wf-carousel-prev {
    left: 8px;
}

.wf-carousel-next {
    right: 8px;
}

.wf-carousel-btn svg {
    width: 18px;
    height: 18px;
}

/* ===== Login Page ===== */

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.login-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 6px;
    text-align: center;
}

.login-subtitle {
    color: #666;
    text-align: center;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.login-error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
    border-radius: 8px;
    padding: 12px 16px;
    color: #dc3545;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.login-field {
    margin-bottom: 16px;
}

.login-field label {
    display: block;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 6px;
    font-weight: 500;
}

.login-input {
    width: 100%;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #ccc;
    border-radius: 8px;
    color: #333;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.login-input:focus {
    border-color: #379bb9;
}

.login-input::placeholder {
    color: #999;
}

.login-btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    margin-top: 8px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(55, 155, 185, 0.93);
    color: #fff;
    transition: background 0.2s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.login-btn:hover {
    background: rgba(55, 155, 185, 1);
}

.login-btn:active {
    transform: scale(0.98);
}
