/* ============================================
   Tesla Overseas – Job Application Form CSS
   (User-defined styles + plugin additions)
============================================ */

:root {
    --primary-color: #2e7d32;
    --secondary-color: #1565c0;
    --bg-color: #f8f9fa;
}

/* Wrapper */
.tjf-wrap {
    font-family: Arial, sans-serif;
    color: #333;
}

/* Notice messages */
.tjf-notice {
    padding: 14px 20px;
    font-weight: 600;
    font-size: 14px;
    border-radius: 4px;
    margin-bottom: 20px;
}
.tjf-notice.success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.tjf-notice.error   { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

/* Main container */
.form-container {
    max-width: 900px;
    margin: auto;
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-top: 8px solid var(--primary-color);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 30px;
}
.company-info h1 { color: var(--primary-color); margin: 0; font-size: 26px; }
.company-info p  { margin: 2px 0; font-size: 13px; color: #666; }

/* Photo upload */
.photo-upload {
    width: 120px;
    height: 140px;
    border: 2px dashed #ccc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 4px;
    background: #fafafa;
    overflow: hidden;
    cursor: pointer;
}
.photo-upload input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.photo-upload span { font-size: 11px; text-align: center; color: #888; padding: 5px; }
.photo-upload svg  { width: 32px; height: 32px; color: #bbb; margin-bottom: 6px; }
.tjf-photo-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* Form title */
.form-title {
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    color: var(--primary-color);
    text-transform: uppercase;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

/* Grid layout */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

section { margin-bottom: 25px; }

.section-title {
    font-weight: bold;
    color: var(--secondary-color);
    font-size: 16px;
    border-left: 4px solid var(--secondary-color);
    padding-left: 10px;
    padding-top: 5px;
    padding-bottom: 5px;
    margin-bottom: 15px;
    background: #eef2f7;
}

/* Fields */
.field {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}
.field label {
    font-size: 13px;
    margin-bottom: 4px;
    font-weight: 600;
    color: #555;
}

input[type="text"],
input[type="date"],
input[type="number"],
select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: 0.3s;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}
input:focus, select:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 5px rgba(21,101,192,0.2);
}

/* Two-column field row */
.tjf-row-2 {
    display: flex;
    gap: 15px;
}
.tjf-row-2 .field { flex: 1; }
.tjf-row-2 .field:first-child { flex: 2; }

/* Applied for sidebar */
.applied-for-card {
    background: #f1f8e9;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #c5e1a5;
    height: fit-content;
}

/* Table (qualifications) */
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { border: 1px solid #eee; padding: 10px; text-align: left; }
th { background: #f5f5f5; font-size: 12px; }
td input {
    width: 100%;
    border: none;
    padding: 4px 6px;
    font-size: 13px;
    background: transparent;
    font-family: inherit;
}
td input:focus { outline: 1px solid var(--secondary-color); border-radius: 2px; }

/* Add/remove row controls */
.tjf-del-row {
    background: #ffebee;
    border: none;
    color: #c62828;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tjf-add-row {
    background: none;
    border: 1.5px dashed var(--secondary-color);
    color: var(--secondary-color);
    border-radius: 4px;
    padding: 6px 16px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 8px;
    font-family: inherit;
    transition: background .15s;
}
.tjf-add-row:hover { background: #eef2f7; }
.tjf-note { font-size: 11px; color: #888; margin-top: 10px; }

/* Language checkboxes */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
}
.checkbox-item input { margin-right: 8px; width: auto; }

/* Signature area */
.signature-area {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 40px;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 4px;
    gap: 24px;
}
.signature-area .field { margin-bottom: 0; }

/* Interviewed by */
.tjf-interviewer-input {
    border: none !important;
    border-bottom: 1px solid #ccc !important;
    border-radius: 0 !important;
    padding: 4px 0 !important;
    width: 220px;
    font-size: 14px;
    background: transparent;
    box-shadow: none !important;
}
.tjf-interviewer-input:focus {
    border-bottom-color: var(--secondary-color) !important;
    outline: none !important;
}

/* Signature upload */
.upload-btn-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}
.btn-upload {
    border: 1px solid #ddd;
    color: #555;
    background-color: white;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}
.upload-btn-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}
#tjf-sig-preview img {
    max-height: 70px;
    margin-top: 8px;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 4px;
}

/* Submit button */
.submit-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 30px;
    transition: 0.3s;
    font-family: inherit;
    letter-spacing: .5px;
}
.submit-btn:hover {
    background: #1b5e20;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.submit-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; box-shadow: none; }

/* Responsive */
@media (max-width: 768px) {
    .main-grid { grid-template-columns: 1fr; }
    .tjf-row-2 { flex-direction: column; }
    .signature-area { flex-direction: column; align-items: flex-start; }
    .form-container { padding: 20px; }
}
