/* ============================================================
   ISIC Upload Form — SOŠ a SOU
   style.css  |  No external dependencies
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    background: #ebebeb;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: #1a3a6b; }
a:hover { text-decoration: underline; }

/* ── Site header ──────────────────────────────────────────── */
.site-header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,.12);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Top bar: logo + service icons */
.header-top {
    display: flex;
    align-items: center;
    justify-content: left;
    padding: 0;
    max-width: 980px;
    margin: 0 auto;
    width: 100%;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    padding: 30px 30px 30px 0;
    border-right: 1px solid #e4e4e4;
}

.header-logo img {
    height: 80px;
}

.header-nav {
    width: 100%;
    height: stretch;
    border-right: 1px solid #e4e4e4;
}
.header-icons {
    width: 100%;
    display: flex;
    gap: 25px;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 1px solid #e4e4e4;
    background: #fafafa;
    padding: 10px 0 30px 30px;
}
.header-icons a img {
    height: 35px;
}
.header-nav-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 15px 0px 0px 25px;
    align-items: center;
}

.home-link {
    display: inline-flex;
    align-items: center;
    padding: 5px 7px;
    font-size: 1.15rem;
    text-decoration: none;
    color: #444;
    border-radius: 3px;
    line-height: 1;
    transition: background .15s;
}

.home-link:hover { background: #e8eef8; text-decoration: none; }

/* ── Main content ─────────────────────────────────────────── */
main {
    flex: 1;
    background: #fff;
    max-width: 980px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 28px 36px;
}

/* ── ISIC card preview ────────────────────────────────────── */
.isic-preview {
    text-align: center;
    margin-bottom: 22px;
}

.isic-preview img {
    max-width: 420px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
}

/* ── Page heading ─────────────────────────────────────────── */
h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 18px;
    border-bottom: 2px solid #1a3a6b;
    padding-bottom: 7px;
}

/* ── Form layout ──────────────────────────────────────────── */
.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.form-row.align-top { align-items: flex-start; }
.form-row.align-top label { padding-top: 5px; }

.form-row label {
    width: 120px;
    min-width: 100px;
    font-size: 1rem;
    padding-right: 10px;
    text-align: left;
    flex-shrink: 0;
    font-weight: 600;
    padding-bottom: 17px;
}

.input-cell { flex: 1; min-width: 0; }

/* Text inputs */
.input-cell input[type=text] {
    width: 100%;
    max-width: 680px;
    border: 1px solid #aaa;
    border-radius: 7px;
    padding: 10px;
    font-size: 1rem;
    color: #333;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.input-cell input[type=text]:focus {
    outline: none;
    border-color: #1a3a6b;
    box-shadow: 0 0 0 2px rgba(26,58,107,.15);
}

/* Třída select */
.trida-select {
    width: 200px;
    border: 1px solid #aaa;
    border-radius: 7px;
    padding: 10px;
    font-size: 1rem;
    color: #333;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s;
}

.trida-select:focus {
    outline: none;
    border-color: #1a3a6b;
    box-shadow: 0 0 0 2px rgba(26,58,107,.15);
}

/* Validation error state */
.input-invalid { border-color: #cc0000 !important; }

.field-err {
    color: #cc0000;
    font-size: .78rem;
    margin-top: 3px;
    min-height: 1.1em;
}

/* ── File input row ───────────────────────────────────────── */
.file-input-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.form-row label.btn-file {
    width: 130px;
    display: inline-block;
    padding: 10px;
    background: #f0f0f0;
    border: 1px solid #aaa;
    border-radius: 7px;
    cursor: pointer;
    font-size: 1rem !important;
    white-space: nowrap;
    position: relative;
    user-select: none;
    transition: background .15s;
}
.form-row label.btn-file:hover {
    background: #e4e4e4;
}

.btn-file:hover { background: #e4e4e4; }

/* Hide the real file input inside the label */
.btn-file input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    font-size: 0;
}

.file-name {
    font-size: .83rem;
    color: #666;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

/* ── Requirements & disclaimer text ──────────────────────── */
.file-requirements {
    margin: 5px 0 20px 0;
    font-size: .9rem;
    color: #707070;
    line-height: 1.5;
    max-width: 640px;
}

.disclaimer {
    margin: 10px 0 20px 0;
    font-size: 1rem;
    color: #222;
    line-height: 1.6;
    max-width: 640px;
}

/* ── Photo preview (after file selection) ─────────────────── */
#preview-wrap {
    display: none;
    margin-top: 10px;
}

#preview-img {
    max-width: 90px;
    max-height: 120px;
    border: 1px solid #bbb;
    border-radius: 2px;
    object-fit: contain;
    display: block;
}

#preview-meta {
    font-size: .73rem;
    color: #666;
    margin-top: 3px;
}

/* ── Submit button ────────────────────────────────────────── */
.submit-row {
    margin-top: 10px;
    padding-left: 120px; /* align with input column */
}

.btn-submit {
    display: inline-block;
    min-width: 160px;
    padding: 20px 30px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #fff;
    background: #28166F;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: background .15s;
}

.btn-submit:hover:not(:disabled) { background: #2a2a4e; }
.btn-submit:disabled { background: #888; cursor: not-allowed; }

/* ── Result messages ──────────────────────────────────────── */
.msg {
    display: none;
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: .88rem;
    line-height: 1.5;
}

.msg code {
    font-family: Consolas, monospace;
    font-size: .85em;
    word-break: break-all;
}

.msg.ok  { display: block; background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.msg.err { display: block; background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: .9em;
    height: .9em;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .65s linear infinite;
    vertical-align: middle;
    margin-right: .35rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ───────────────────────────────────────────────── */
footer {
    background: #1D252D;
    color: #bbb;
}

.footer-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-social {
    display: flex;
    gap: 10px;
    align-items: center;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}
.footer-social a img {
    width: 40px;
    height: 40px;
    opacity: .6;
}

.footer-seal a img {
    width: 80px;
    height: 80px;
    opacity: .6;
}

.footer-info {
    text-align: right;
    font-size: 0.8rem;
    line-height: 1.65;
}

.footer-info a { color: #aaa; text-decoration: none; }
.footer-info a:hover { color: #fff; text-decoration: underline; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
    .header-top { padding: 8px 12px; flex-wrap: wrap; gap: 8px; }
    .logo-text { display: none; }
    main { padding: 16px 14px 28px; }
    .form-row { flex-direction: column; align-items: flex-start; }
    .form-row.align-top label { padding-top: 0; }
    .form-row label { width: auto; text-align: left; padding-right: 0; margin-bottom: 3px; }
    .input-cell input[type=text],
    .trida-select { max-width: 100%; width: 100%; }
    .submit-row { padding-left: 0; }
    .btn-submit { width: 100%; }
    .footer-inner { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
    .footer-info { text-align: center; }
}

@media (max-width: 420px) {
    .header-icons { display: none; }
}
