/* ============================================================
   Joemarine CMS — Registration Form Stylesheet
   Completely isolated class names (reg-*) to avoid conflicts.
   ============================================================ */

/* ── Outer wrapper ─────────────────────────────────────────── */
.reg-wrap {
    max-width: 820px;
    margin: 32px auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 32px rgba(0,0,0,.12);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Header ────────────────────────────────────────────────── */
.reg-header {
    background: linear-gradient(135deg, #1a3a6b 0%, #2e5899 100%);
    padding: 28px 32px;
    color: #fff;
}
.reg-header-inner {
    display: flex;
    align-items: center;
    gap: 18px;
}
.reg-header-icon {
    font-size: 48px;
    flex-shrink: 0;
    line-height: 1;
}
.reg-header h2 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
}
.reg-header p {
    margin: 0;
    font-size: 13px;
    opacity: .82;
    color: #fff;
}

/* ── Alert bar ─────────────────────────────────────────────── */
.reg-alert {
    margin: 20px 28px 0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}
.reg-alert.reg-success { background: #eafaf1; border: 1px solid #a9dfbf; color: #1e8449; }
.reg-alert.reg-error   { background: #fdedec; border: 1px solid #f5b7b1; color: #922b21; }
.reg-alert.reg-info    { background: #eaf4fb; border: 1px solid #aed6f1; color: #1a5276; }

/* ── Sections ──────────────────────────────────────────────── */
.reg-section {
    padding: 28px 32px;
    border-bottom: 1px solid #eaecf0;
}
.reg-section:last-of-type {
    border-bottom: none;
}
.reg-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    color: #1a3a6b;
    margin-bottom: 22px;
}
.reg-section-num {
    width: 26px;
    height: 26px;
    background: #1a3a6b;
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}

/* ── Photo + personal row ──────────────────────────────────── */
.reg-photo-row {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}
.reg-photo-col {
    flex-shrink: 0;
    width: 150px;
}
.reg-fields-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ── Passport photo box ────────────────────────────────────── */
.reg-photo-box {
    /* label element styled as the clickable photo box */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 185px;
    border: 2.5px dashed #c0c8d8;
    border-radius: 10px;
    background: #f7f9fc;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: border-color .2s, background .2s;
    /* reset label defaults */
    font-weight: normal;
    margin: 0;
    -webkit-tap-highlight-color: transparent;
}
.reg-photo-box:hover,
.reg-photo-box:focus-within {
    border-color: #1a3a6b;
    background: #eef2f9;
}
.reg-photo-box.drag-over {
    border-color: #c9a227;
    background: #fffdf0;
    border-style: solid;
}

/* File input: NOT display:none — positioned off-screen so mobile can trigger it via <label> */
.reg-file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    left: -9999px;
    top: -9999px;
}

#reg-photo-placeholder {
    text-align: center;
    padding: 12px;
    pointer-events: none;
}
.reg-photo-icon { font-size: 36px; display: block; margin-bottom: 8px; }
#reg-photo-placeholder p     { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: #1a3a6b; }
#reg-photo-placeholder small { font-size: 10px; color: #7f8c8d; display: block; line-height: 1.6; }

#reg-photo-preview-wrap {
    width: 100%;
    height: 100%;
}
#reg-photo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* Remove button — outside the label so tapping it doesn't re-open the file picker */
.reg-photo-remove-outer {
    display: none;
    width: 150px;
    margin-top: 6px;
    padding: 6px 0;
    background: #fdedec;
    color: #922b21;
    border: 1px solid #f5b7b1;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    transition: background .15s;
}
.reg-photo-remove-outer:hover { background: #f5b7b1; }

#reg-photo-uploading {
    text-align: center;
    padding: 20px 14px;
    width: 100%;
}
.reg-prog-bar {
    width: 100%;
    height: 6px;
    background: #dde2ec;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}
#reg-prog-fill {
    height: 100%;
    background: #1a3a6b;
    border-radius: 4px;
    width: 0%;
    transition: width .2s;
}
#reg-photo-uploading small { font-size: 11px; color: #7f8c8d; }

/* ── Form fields ───────────────────────────────────────────── */
.reg-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.reg-label,
.reg-field label {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    display: block;
    margin-bottom: 2px;
}
.reg-req { color: #e74c3c; }
.reg-hint {
    font-size: 11px;
    color: #7f8c8d;
    line-height: 1.4;
}

.reg-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #dde2ec;
    border-radius: 8px;
    font-size: 14px;
    color: #2c3e50;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
}
.reg-input:focus {
    outline: none;
    border-color: #1a3a6b;
    box-shadow: 0 0 0 3px rgba(26,58,107,.10);
}
.reg-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%237f8c8d' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

/* ── 3-column date grid ────────────────────────────────────── */
.reg-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 18px;
    margin-top: 18px;
}

/* ── Submit row ────────────────────────────────────────────── */
.reg-submit-row {
    padding: 24px 32px 28px;
    text-align: center;
    background: #f7f9fc;
    border-top: 1px solid #eaecf0;
}

.reg-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 48px;
    background: #1a3a6b;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    font-family: inherit;
    min-width: 240px;
}
.reg-submit-btn:hover {
    background: #14336b;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26,58,107,.30);
}
.reg-submit-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 680px) {
    .reg-wrap { margin: 0; border-radius: 0; }
    .reg-header { padding: 20px 18px; }
    .reg-section { padding: 20px 18px; }
    .reg-photo-row { flex-direction: column; align-items: center; }
    .reg-photo-col { width: 150px; }
    .reg-fields-col { width: 100%; }
    .reg-grid-3 { grid-template-columns: 1fr; }
    .reg-submit-row { padding: 18px; }
    .reg-submit-btn { width: 100%; padding: 14px; }
    .reg-alert { margin: 14px 18px 0; }
}
@media (max-width: 420px) {
    .reg-header-inner { flex-direction: column; text-align: center; gap: 10px; }
}
