/* cid.css - Compact version for CID Update Form */
/* Modern, clean, and responsive design with Green & Blue theme */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #e1e4ea 0%, #e7ebf1 100%);
    min-height: 100vh;
}

/* ===== MAIN CONTAINER ===== */
.update-cid-wrapper {
    max-width: 1000px;
    margin: 3rem auto;
    margin-top: 7rem;
    animation: fadeInUp 0.4s ease-out;
}

.cid-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cid-card:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

/* ===== HEADER SECTION ===== */
.cid-header {
    background: green;
    padding: 1.25rem 1.5rem 1rem;
    text-align: center;
    color: white;
}

.cid-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.2px;
}

.cid-header p {
    font-size: 0.8rem;
    opacity: 0.85;
    margin-top: 0.15rem;
}

/* ===== FORM STYLES ===== */
.cid-form {
    padding: 1.25rem 1.5rem 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
    color: #1f2937;
}

.required {
    color: #dc2626;
    font-weight: 700;
    margin-left: 2px;
}

.optional {
    color: #6b7280;
    font-weight: 400;
    font-size: 0.7rem;
    margin-left: 4px;
}

.field-note {
    display: block;
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Input fields */
.form-group input,
.form-group select {
    width: 100%;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s ease;
    background: #fafbfc;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1a7f6b;
    box-shadow: 0 0 0 2px rgba(26, 127, 107, 0.1);
    background: white;
}

.form-group input:hover,
.form-group select:hover {
    border-color: #cbd5e1;
}

/* Date inputs specific */
input[type="date"] {
    cursor: pointer;
}

/* ===== FORM ROW (two columns) ===== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0;
}

.form-row .form-group {
    margin-bottom: 1rem;
}

/* ===== TWO COLUMN LAYOUT FOR UPLOADS ===== */
.two-uploads-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0;
}

/* ===== FILE UPLOAD AREA ===== */
.upload-group {
    margin-bottom: 1rem;
}

.file-field {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    background: #f9fafb;
    border: 1.5px dashed #d1d5db;
    border-radius: 10px;
    padding: 0.4rem 0.85rem;
    transition: all 0.2s ease;
}

.file-field:hover {
    border-color: #1a7f6b;
    background: #fefeff;
}

.file-field input[type="file"] {
    flex: 1;
    padding: 0.3rem 0;
    border: none;
    background: transparent;
    font-size: 0.8rem;
    cursor: pointer;
}

.file-field input[type="file"]::-webkit-file-upload-button {
    background: green;
    color: white;
    border: none;
    padding: 0.35rem 0.85rem;
    border-radius: 7px;
    font-weight: 500;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
    margin-right: 0.6rem;
}

.file-field input[type="file"]::-webkit-file-upload-button:hover {
    background: #0f5c1c;
}

.file-name {
    font-size: 0.7rem;
    color: #4b5563;
    background: #f3f4f6;
    padding: 0.2rem 0.6rem;
    border-radius: 16px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-name.has-file {
    background: #d1fae5;
    color: #065f46;
    font-weight: 500;
}

/* ===== IMAGE PREVIEWS ROW (side by side) ===== */
.image-previews-row {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

/* Individual preview card */
.image-preview-card {
    flex: 1;
    min-width: 140px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    position: relative;
    transition: all 0.2s ease;
}

.image-preview-card:hover {
    border-color: #1a7f6b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-preview-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
}

.image-preview-card .remove-image {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.image-preview-card .remove-image:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* ===== SUBMIT BUTTON - SHORTER ===== */
.form-actions {
    margin-top: 1.25rem;
}

.submit-btn {
    width: auto;
    min-width: 200px;
    background: green;
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -4px rgba(26, 127, 107, 0.35);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.submit-btn.loading {
    background: linear-gradient(135deg, #0f5c4d 0%, #0a3d48 100%);
}

.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.form-actions {
    text-align: center;
}

/* ===== RESPONSE MESSAGES ===== */
.response-area {
    padding: 0 1.5rem 1.25rem 1.5rem;
}

.alert {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    font-weight: 500;
    animation: slideIn 0.25s ease;
    position: relative;
}

.alert-success {
    background: #ecfdf5;
    border-left: 4px solid #10b981;
    color: #065f46;
}

.alert-error {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.alert-info {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

.alert-icon {
    font-size: 1.1rem;
    font-weight: bold;
}

.alert-content {
    flex: 1;
    font-size: 0.8rem;
    line-height: 1.35;
}

.alert-close {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.2s;
    line-height: 1;
    padding: 0 0.2rem;
}

.alert-close:hover {
    opacity: 1;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== SELECT DROPDOWN STYLING ===== */
select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' 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 0.85rem center;
    background-size: 1rem;
}

/* ===== PLACEHOLDER STYLING ===== */
::placeholder {
    color: #9ca3af;
    font-weight: 400;
    font-size: 0.8rem;
}

/* ===== FOCUS VISIBLE FOR ACCESSIBILITY ===== */
.submit-btn:focus-visible,
.form-group input:focus-visible,
.form-group select:focus-visible,
.file-field input:focus-visible {
    outline: 2px solid #1a7f6b;
    outline-offset: 2px;
}

/* ===== LOADING STATE FOR BUTTON TEXT ===== */
.submit-btn .btn-text {
    transition: opacity 0.2s;
}

/* ===== DISABLED INPUT STYLES ===== */
.form-group input:disabled,
.form-group select:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ===== ERROR STATE FOR INPUTS ===== */
.form-group input.error,
.form-group select.error {
    border: 1.5px solid #ef4444 !important;
    background: #fef2f2 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1) !important;
}

/* ===== SMOOTH SCROLL BEHAVIOR ===== */
html {
    scroll-behavior: smooth;
}

footer {
    background-color: #343a40;
    color: white;
    text-align: center;
    padding: 10px 0px;
    margin-top: 0;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .update-cid-wrapper {
        max-width: 95%;
        margin: 3rem auto;
        margin-top: 7rem;
    }
}

@media (max-width: 640px) {
    body {
        padding: 0.75rem;
    }
    
    .cid-header {
        padding: 1rem 1rem 0.85rem;
    }
    
    .cid-header h2 {
        font-size: 1.25rem;
    }
    
    .cid-form {
        padding: 1rem 1.25rem 0.75rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 1rem;
    }
    
    .two-uploads-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .file-field {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-field input[type="file"] {
        width: 100%;
    }
    
    .file-name {
        max-width: 100%;
        width: 100%;
        text-align: center;
    }
    
    .image-previews-row {
        flex-direction: column;
    }
    
    .image-preview-card {
        min-width: auto;
    }
    
    .image-preview-card img {
        height: 150px;
    }
    
    .response-area {
        padding: 0 1.25rem 1rem 1.25rem;
    }
    
    .alert {
        padding: 0.6rem 0.85rem;
    }
    
    .submit-btn {
        width: 100%;
        min-width: auto;
    }
}

/* ===== CAPTCHA STYLES - Left aligned, same width as other fields ===== */
.captcha-wrapper {
    display: flex;
    justify-content: flex-start;
}

.captcha-group {
    width: 49%;
    max-width: 100%;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.captcha-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    font-family: 'Courier New', monospace;
    flex-shrink: 0;
}

.captcha-code {
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 3px;
    color: #1a7f6b;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
    user-select: none;
    min-width: 120px;
    text-align: center;
    padding: 0.2rem 0.5rem;
}

.captcha-refresh {
    background: green;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    white-space: nowrap;
}

.captcha-refresh:hover {
    background: #0f5c1c;
    transform: scale(1.02);
}

.captcha-container input {
    flex: 1;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s ease;
    background: #fafbfc;
    font-family: inherit;
}

.captcha-container input:focus {
    outline: none;
    border-color: #1a7f6b;
    box-shadow: 0 0 0 2px rgba(26, 127, 107, 0.1);
    background: white;
}

.captcha-container input.error {
    border: 1.5px solid #ef4444 !important;
    background: #fef2f2 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1) !important;
}

/* Tablet Responsive */
@media (max-width: 768px) {
    .captcha-group {
        width: 100%;
    }
    
    .captcha-code {
        min-width: 100px;
        font-size: 1.1rem;
    }
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .captcha-group {
        width: 100%;
    }
    
    .captcha-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .captcha-display {
        width: 100%;
        justify-content: space-between;
    }
    
    .captcha-code {
        min-width: auto;
        flex: 1;
        font-size: 1rem;
        letter-spacing: 2px;
    }
    
    .captcha-container input {
        width: 100%;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .captcha-code {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }
    
    .captcha-display {
        padding: 0.25rem 0.4rem;
        gap: 0.3rem;
    }
    
    .captcha-refresh {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .captcha-container input {
        padding: 0.45rem 0.7rem;
        font-size: 0.8rem;
    }
}