/* ── Synnio Workflow Forms – Frontend CSS ── */

/* Container */
.swf-form-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 680px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(0,0,0,.10);
    overflow: hidden;
}

/* Header */
.swf-form-header {
    padding: 24px 32px 16px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
}
.swf-progress-bar {
    height: 4px;
    background: rgba(255,255,255,.2);
    border-radius: 2px;
    margin-bottom: 16px;
    overflow: hidden;
}
.swf-progress-fill {
    height: 100%;
    background: #4ade80;
    border-radius: 2px;
    transition: width .5s cubic-bezier(.4,0,.2,1);
}
.swf-job-title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}
.swf-step-indicator {
    margin: 0;
    font-size: 13px;
    color: rgba(255,255,255,.6);
}

/* Form body */
.swf-form-body {
    padding: 32px;
    min-height: 280px;
}

/* Node title and description */
.swf-node-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
    line-height: 1.35;
}
.swf-node-desc {
    font-size: 15px;
    color: #666;
    margin: 0 0 20px;
    line-height: 1.6;
}

/* Options grid */
.swf-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.swf-option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .15s;
    background: #fff;
    user-select: none;
    text-align: center;
}
.swf-option-card:hover {
    border-color: #1a73e8;
    box-shadow: 0 2px 12px rgba(26,115,232,.15);
    transform: translateY(-1px);
}
.swf-option-card.swf-selected {
    border-color: #1a73e8;
    background: #e8f0fe;
    box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}
.swf-option-card input { position: absolute; opacity: 0; pointer-events: none; }
.swf-opt-img {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f3f4f6;
}
.swf-opt-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #9ca3af;
}
.swf-opt-label {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
}
.swf-opt-desc { font-size: 12px; color: #6b7280; line-height: 1.4; }

/* Upload */
.swf-upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    margin-bottom: 12px;
}
.swf-upload-zone:hover { border-color: #1a73e8; background: #f0f4ff; }
.swf-upload-icon { font-size: 32px; margin-bottom: 8px; }
.swf-upload-zone p { margin: 0 0 4px; font-size: 15px; font-weight: 500; color: #374151; }
.swf-upload-zone small { font-size: 12px; color: #9ca3af; }
.swf-file-list { margin-bottom: 16px; }
.swf-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}
.swf-file-item button { background: none; border: none; color: #9ca3af; cursor: pointer; font-size: 14px; padding: 0 4px; }
.swf-file-item button:hover { color: #e53935; }

/* Text input */
.swf-text-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color .2s;
    resize: vertical;
    box-sizing: border-box;
    margin-bottom: 20px;
}
.swf-text-input:focus { outline: none; border-color: #1a73e8; }

/* Contact form */
.swf-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
@media (max-width: 480px) { .swf-contact-grid { grid-template-columns: 1fr; } }
.swf-field label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 4px; }
.swf-field input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color .2s;
    box-sizing: border-box;
}
.swf-field input:focus { outline: none; border-color: #1a73e8; }
.swf-privacy-field { margin-bottom: 20px; }
.swf-privacy-label { display: flex !important; align-items: flex-start; gap: 10px; font-weight: 400 !important; font-size: 13px !important; color: #555; cursor: pointer; }
.swf-privacy-label input { width: auto; margin-top: 2px; flex-shrink: 0; }

/* Buttons */
.swf-next-btn, .swf-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #1a73e8, #1557b0);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s, box-shadow .2s;
    text-decoration: none;
    font-family: inherit;
}
.swf-next-btn:hover, .swf-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26,115,232,.35);
}
.swf-success-btn { background: linear-gradient(135deg, #43a047, #2e7d32); }
.swf-submit-btn { width: 100%; }

/* Navigation (back) */
.swf-form-nav { padding: 0 32px 24px; }
.swf-btn-back {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    transition: color .2s;
    font-family: inherit;
}
.swf-btn-back:hover { color: #374151; }

/* Error message */
.swf-error-msg {
    background: #fce4ec;
    color: #b71c1c;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 14px;
}

/* Success */
.swf-success {
    text-align: center;
    padding: 40px 20px;
}
.swf-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: #e8f5e9;
    color: #43a047;
    border-radius: 50%;
    font-size: 28px;
    margin-bottom: 16px;
}
.swf-success h3 { font-size: 20px; color: #1a1a2e; margin: 0 0 20px; }

/* Loading / spinner */
.swf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 14px;
    gap: 12px;
}
.swf-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: swf-spin .7s linear infinite;
}
.swf-redirect-msg {
    text-align: center;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: #6b7280;
    font-size: 15px;
}
@keyframes swf-spin { to { transform: rotate(360deg); } }

/* Enter animation */
.swf-enter { animation: swf-fade-up .3s ease both; }
@keyframes swf-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Mobile */
@media (max-width: 600px) {
    .swf-form-header { padding: 20px; }
    .swf-form-body { padding: 20px; }
    .swf-form-nav { padding: 0 20px 20px; }
    .swf-job-title { font-size: 18px; }
    .swf-node-title { font-size: 17px; }
    .swf-options-grid { grid-template-columns: 1fr 1fr; }
}
