/* ─────────────────────────────────────────────────────────────────────────────
   WorkNow — Η φόρμα «ένα κλικ»: αγγελία + λογαριασμός + πληρωμή.

   Τη μοιράζονται δύο σελίδες: η /find-staff.html (κανονικές αγγελίες)
   και η /one-day-jobs.html (αγγελίες μίας ημέρας). Ό,τι αφορά τη φόρμα ζει
   ΕΔΩ, μία φορά: μια διόρθωση για το κινητό ισχύει αυτόματα και στις δύο.
   Ό,τι αφορά μόνο τη μία σελίδα (ήρωας, κάρτες, προεπισκόπηση) μένει inline.
   Η λογική της φόρμας ζει στο /js/one-step.js.
   ───────────────────────────────────────────────────────────────────────────── */

/* Στην οριζόντια θέση το iPhone μεγαλώνει μόνο του τα γράμματα: εδώ μένουν
   όπως σχεδιάστηκαν. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

[hidden] { display: none !important; }

.os-card {
    background: #fff;
    border: 1px solid rgba(25, 118, 210, 0.2);
    border-radius: 20px;
    padding: 2rem 2.1rem;
    box-shadow: 0 18px 40px -30px rgba(13, 71, 161, 0.55);
    scroll-margin-top: 90px;
}

.os-loading { text-align: center; color: #78858f; padding: 1.5rem 0; margin: 0; }

/* ── Τα τρία βήματα ── */
/* Γραμμή πριν από κάθε βήμα εκτός του πρώτου ΟΡΑΤΟΥ (στην πληρωμή
   αγγελίας που ήδη υπάρχει, το βήμα της αγγελίας κρύβεται). */
.os-step:not([hidden]) ~ .os-step {
    border-top: 1px solid #e8eef5;
    margin-top: 1.9rem;
    padding-top: 1.9rem;
}

.os-step { scroll-margin-top: 90px; }

.os-step-head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1.4rem;
}

.os-step-num {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1976d2, #1565c0);
    color: #fff;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.os-step-head h2 { font-size: 1.25rem; color: #2c3e50; margin: 0.2rem 0 0; }
.os-step-head p { margin: 0.2rem 0 0; color: #78858f; font-size: 0.88rem; line-height: 1.5; }

.os-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.3rem; }
.os-row.narrow-end { grid-template-columns: 2fr 1fr; }

.field { margin-bottom: 1.2rem; min-width: 0; }

.field > label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: #f8fafc;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input:not([type="file"]),
.field textarea { -webkit-appearance: none; appearance: none; }

.field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%231976d2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px 18px;
    padding-right: 44px;
    cursor: pointer;
}

.field textarea { min-height: 130px; resize: vertical; }

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: #1976d2;
    outline: none;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12);
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea { border-color: #e53935; background-color: #fff; }

.field-error { display: block; margin-top: 0.35rem; color: #c62828; font-size: 0.83rem; font-weight: 600; }
.hint { display: block; margin-top: 0.4rem; color: #78858f; font-size: 0.83rem; line-height: 1.45; }
.req { color: #e53935; }

/* Απαιτήσεις / οφέλη: ίδια λογική με το /add_job.html. */
.dyn-item { display: flex; gap: 0.6rem; margin-bottom: 0.6rem; }
.dyn-item input { flex: 1; min-width: 0; }

.dyn-remove {
    flex-shrink: 0;
    width: 46px;
    border: 2px solid #f3d0d0;
    background: #fff5f5;
    color: #d32f2f;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.dyn-remove:hover { background: #ffebee; border-color: #e57373; }

.dyn-add {
    background: none;
    border: 2px dashed rgba(25, 118, 210, 0.35);
    color: #1565c0;
    font-weight: 700;
    font-family: inherit;
    font-size: 0.9rem;
    border-radius: 10px;
    padding: 0.55rem 1rem;
    min-height: 44px;
    cursor: pointer;
}

.dyn-add:hover { border-color: #1976d2; background: #f0f7ff; }

/* ── Λογαριασμός ── */
.tabs {
    display: inline-flex;
    flex-wrap: wrap;
    background: #f0f4f8;
    border-radius: 50px;
    padding: 4px;
    margin-bottom: 1.3rem;
}

.tabs button {
    border: none;
    background: none;
    padding: 0.55rem 1.15rem;
    min-height: 44px;
    border-radius: 50px;
    font-weight: 700;
    font-family: inherit;
    font-size: 0.9rem;
    color: #4a5a6a;
    cursor: pointer;
}

.tabs button.active { background: #fff; color: #1565c0; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); }

.me-box,
.credit-note,
.resume-banner {
    padding: 0.95rem 1.15rem;
    border-radius: 12px;
    font-size: 0.93rem;
    line-height: 1.55;
}

.me-box { background: #f0f7ff; border: 1px solid rgba(25, 118, 210, 0.28); color: #0d47a1; }
.me-box .muted { color: #4a5a6a; }
.me-box button {
    background: none; border: none; padding: 0 0.2rem; color: #1565c0; font-weight: 700;
    font-family: inherit; font-size: inherit; cursor: pointer; text-decoration: underline;
    min-height: 44px; display: inline-flex; align-items: center; vertical-align: middle;
}

.credit-note { background: #e8f5e9; border: 1px solid #a5d6a7; color: #1b5e20; }

.resume-banner { background: #fff8e1; border: 1px solid #ffe0a3; color: #6b4f14; margin-bottom: 1.6rem; }
.resume-banner.info { background: #f0f7ff; border-color: rgba(25, 118, 210, 0.28); color: #0d47a1; }
.resume-banner a { color: #1565c0; font-weight: 700; }

.btn-secondary {
    background: #fff;
    color: #1565c0;
    border: 2px solid rgba(25, 118, 210, 0.35);
    border-radius: 50px;
    padding: 0.75rem 1.6rem;
    min-height: 44px;
    font-weight: 800;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
}

.forgot-link { display: inline-flex; align-items: center; min-height: 44px; vertical-align: middle; margin-left: 1rem; color: #1565c0; font-weight: 600; font-size: 0.9rem; }

.btn-secondary:hover:not(:disabled) { border-color: #1976d2; }
.btn-secondary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Πακέτα ── */
.pkg-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.9rem;
    margin-bottom: 0.6rem;
}

.pkg {
    position: relative;
    display: block;
    border: 2px solid #e0e6ed;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.pkg input { position: absolute; opacity: 0; pointer-events: none; }
.pkg:hover { border-color: rgba(25, 118, 210, 0.5); }
.pkg.selected { border-color: #1976d2; background: #fff; box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12); }
.pkg:focus-within { box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.25); }

.pkg-name { display: block; font-weight: 800; color: #2c3e50; padding-right: 1.4rem; }
.pkg-price { display: block; font-size: 1.4rem; font-weight: 800; color: #1565c0; margin-top: 0.3rem; }
.pkg-sub { display: block; font-size: 0.83rem; color: #78858f; margin-top: 0.15rem; }
.pkg-sub .nowrap { white-space: nowrap; }
.pkg-vat { display: block; font-size: 0.74rem; font-weight: 600; color: #6b7c8c; letter-spacing: 0; margin-top: 0.1rem; }

.pkg-badge {
    position: absolute;
    top: -11px;
    right: 12px;
    background: #1976d2;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
}

.pkg.selected::after {
    content: '✓';
    position: absolute;
    top: 0.85rem;
    right: 0.95rem;
    color: #1976d2;
    font-weight: 800;
}

.pkg-extra { color: #4a5a6a; font-size: 0.86rem; margin: 0 0 1.4rem; line-height: 1.5; }

.billing-type { display: flex; flex-wrap: wrap; gap: 1.6rem; margin: 0.4rem 0 1.1rem; }
.billing-type label { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; padding-right: 0.4rem; cursor: pointer; font-weight: 600; color: #2c3e50; }
.billing-type input { width: 17px; height: 17px; accent-color: #1976d2; }

.invoice-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1rem 1rem 0.1rem; margin-bottom: 1.2rem; }
.invoice-box .field input { background: #fff; }

.sub-label { font-weight: 700; color: #2c3e50; font-size: 0.95rem; margin: 0.4rem 0 0.8rem; }

/* ── Ολοκλήρωση ── */
.terms {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: #f0f7ff;
    border: 1px solid rgba(25, 118, 210, 0.22);
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    margin-top: 1.6rem;
}

.terms input { width: 22px; height: 22px; margin: 0; accent-color: #1976d2; flex-shrink: 0; cursor: pointer; }
.terms.invalid { border-color: #e53935; background: #fff5f5; }

.terms-links { margin: 0.2rem 0 0; padding-left: 1.1rem; font-size: 0.85rem; color: #78858f; }
.terms-links a { display: inline-flex; align-items: center; min-height: 44px; color: #1565c0; font-weight: 700; }

.summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem 1.2rem;
    margin-top: 1.4rem;
}

.summary-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.25rem 0; color: #4a5a6a; font-size: 0.95rem; }
.summary-row span:last-child { white-space: nowrap; }
.summary-row.total { border-top: 1px solid #e2e8f0; margin-top: 0.45rem; padding-top: 0.65rem; font-weight: 800; color: #2c3e50; font-size: 1.12rem; }

.os-msg { padding: 0.9rem 1.1rem; border-radius: 12px; margin-top: 1.4rem; font-size: 0.93rem; line-height: 1.55; }
.os-msg.ok { background: #e8f5e9; border: 1px solid #a5d6a7; color: #1b5e20; }
.os-msg.err { background: #ffebee; border: 1px solid #ef9a9a; color: #b71c1c; }
.os-msg button { background: none; border: none; padding: 0; color: inherit; font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }

.os-submit {
    display: block;
    width: 100%;
    margin-top: 1.3rem;
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 1.1rem 1.5rem;
    font-size: 1.08rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(25, 118, 210, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.os-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(25, 118, 210, 0.36); }
.os-submit:disabled { opacity: 0.65; cursor: not-allowed; }

.os-secure { text-align: center; color: #78858f; font-size: 0.85rem; line-height: 1.5; margin: 0.9rem 0 0; }

.nowrap { white-space: nowrap; }

@media (max-width: 700px) {
    .os-card { padding: 1.4rem 1.1rem; }
    .os-row,
    .os-row.narrow-end { grid-template-columns: 1fr; }
}

/* ── Κινητό ─────────────────────────────────────────────────────────────────
   Ό,τι στο desktop είναι κουτί δίπλα σε κουτί, εδώ γίνεται γραμμή: κείμενο που
   σπάει σε δύο γραμμές μέσα σε στρογγυλό κουτί φαίνεται χαλασμένο. */
@media (max-width: 520px) {
    /* Νέος / υπάρχων λογαριασμός: δύο ίσα κουμπιά σε όλο το πλάτος. */
    .tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        box-sizing: border-box;
        border-radius: 14px;
    }

    .tabs button { border-radius: 10px; padding: 0.55rem 0.5rem; line-height: 1.25; }

    /* Πακέτα: μία γραμμή το καθένα, τιμή δεξιά. */
    .pkg-list { gap: 0.8rem; }

    .pkg {
        display: grid;
        grid-template-columns: 1fr auto;
        column-gap: 0.8rem;
        align-items: center;
        padding: 0.85rem 2.3rem 0.85rem 1rem;
    }

    .pkg-name { grid-column: 1; grid-row: 1; padding-right: 0; }
    /* Λίγο μικρότερα: στο Safari, στα ~412px, το «24,50 € / αγγελία» ξεπερνούσε
       κατά 3px τη στήλη του. */
    .pkg-sub { grid-column: 1; grid-row: 2; font-size: 0.8rem; }
    .pkg-price { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; font-size: 1.2rem; text-align: right; }
    .pkg.selected::after { top: 50%; right: 0.9rem; transform: translateY(-50%); }
}

@media (max-width: 360px) {
    .os-card { padding: 1.2rem 0.9rem; }
    .summary { padding: 0.9rem 0.95rem; }
}

/* Στην αφή το :hover «κολλάει» μετά το πάτημα και το κουμπί θα έμενε
   ανασηκωμένο. Το ανασήκωμα μόνο όπου υπάρχει ποντίκι. */
@media (hover: none) {
    .os-submit:hover:not(:disabled) { transform: none; }
}
