/* ==========================================================================
   HanHosting - Modern White & Corporate Orange Premium Design System
   ========================================================================== */

:root {
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    --bg-input: #f8fafc;
    --border-color: #e2e8f0;
    --border-glow: rgba(249, 115, 22, 0.3);
    
    --primary: #f97316;
    --primary-alt: #ea580c;
    --primary-gradient: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    --secondary-gradient: linear-gradient(135deg, #fb923c 0%, #d97706 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-dark: #94a3b8;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --shadow-main: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
    --shadow-glow: 0 10px 25px rgba(249, 115, 22, 0.25);
    --font-family: 'Plus Jakarta Sans', 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset & Base Setup */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    user-select: none; /* Anti-tamper text selection block */
}

/* Disable selection except inside inputs and textareas */
input, textarea, [contenteditable="true"] {
    user-select: text !important;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(249, 115, 22, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(234, 88, 12, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    padding: 30px 15px 60px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    line-height: 1.6;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #e2e8f0;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Main Wrapper */
.form-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Crisp White Cards Base */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px 35px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.form-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

/* Header Banner Card */
.form-banner {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 24px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-main);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 35px 20px;
    position: relative;
}

.form-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: var(--primary-gradient);
}

.banner-logo {
    max-height: 75px;
    max-width: 85%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.banner-logo:hover {
    transform: scale(1.02);
}

/* Header Info Card */
.header-card {
    border-left: 5px solid var(--primary);
}

.form-main-title {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--primary-alt);
    margin-bottom: 12px;
}

.form-main-desc {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.required-notice {
    font-size: 0.82rem;
    color: #dc2626;
    font-weight: 600;
}

/* Question Cards */
.question-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.question-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.question-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-main);
}

.required-star {
    color: #dc2626;
    margin-left: 4px;
}

.question-description-text {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Inputs & Form Controls */
.form-text-input, 
.form-textarea-input {
    width: 100%;
    background: var(--bg-input);
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    color: var(--text-main);
    font-size: 0.98rem;
    outline: none;
    transition: all 0.25s ease;
}

.form-text-input:focus, 
.form-textarea-input:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12);
}

.form-textarea-input {
    resize: vertical;
    min-height: 110px;
}

/* Radio & Checkbox Options */
.radio-option, .checkbox-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.radio-option:hover, .checkbox-option:hover {
    background: #fff7ed;
    border-color: #fdba74;
}

.radio-option input[type="radio"],
.checkbox-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #94a3b8;
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-option input[type="checkbox"] {
    border-radius: 6px;
}

.radio-option input[type="radio"]:checked,
.checkbox-option input[type="checkbox"]:checked {
    border-color: var(--primary);
    background: var(--primary);
}

.radio-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 8px; height: 8px;
    background: #ffffff;
    border-radius: 50%;
}

.checkbox-option input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-weight: 900;
    font-size: 13px;
}

.radio-label-text, .checkbox-label-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    flex-grow: 1;
}

.other-input-wrapper {
    margin-top: 10px;
    width: 100%;
}

/* Linear Scale (1-10) */
.linear-scale-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f8fafc;
    padding: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid #e2e8f0;
    overflow-x: auto;
}

.scale-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.scale-options {
    display: flex;
    gap: 8px;
}

.scale-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.scale-option label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-muted);
}

.scale-option input[type="radio"] {
    appearance: none;
    width: 26px; height: 26px;
    border: 2px solid #94a3b8;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scale-option input[type="radio"]:checked {
    border-color: var(--primary);
    background: var(--primary-gradient);
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.4);
}

/* Rating Grid Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.rating-grid-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.rating-grid-table th, 
.rating-grid-table td {
    padding: 14px 10px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.rating-grid-table th {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
}

.rating-grid-table td.row-label {
    text-align: left;
    font-weight: 600;
    font-size: 0.93rem;
    color: var(--text-main);
    min-width: 180px;
}

.rating-grid-table input[type="radio"] {
    appearance: none;
    width: 22px; height: 22px;
    border: 2px solid #94a3b8;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rating-grid-table input[type="radio"]:checked {
    border-color: var(--primary);
    background: var(--primary);
}

/* Error Messages */
.error-msg {
    display: none;
    color: #dc2626;
    font-size: 0.85rem;
    font-weight: 600;
    gap: 6px;
    align-items: center;
    margin-top: 4px;
}

.has-error .error-msg {
    display: flex;
}

.has-error .form-card {
    border-color: #fca5a5;
}

/* Form Action Buttons */
.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 10px;
}

.btn-submit-form {
    background: var(--primary-gradient);
    color: #ffffff;
    font-weight: 800;
    font-size: 1rem;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-glow);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-submit-form:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(249, 115, 22, 0.35);
}

.btn-clear-form {
    background: #ffffff;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 14px 24px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear-form:hover {
    background: #f8fafc;
    color: var(--text-main);
}

/* Overlay & Spinners */
.form-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background: #ffffff;
    padding: 30px 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-main);
}

.spinner {
    width: 50px; height: 50px;
    border: 4px solid #ffedd5;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Success Card */
.success-card {
    text-align: center;
    border-left: none;
    padding: 40px;
}

.success-message-text {
    font-size: 1.8rem;
    font-weight: 800;
    color: #10b981;
    margin: 15px 0 10px;
}

.success-sub-text {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 25px;
}

.receipt-block {
    background: #fff7ed;
    border: 1.5px dashed #fdba74;
    border-radius: var(--radius-sm);
    padding: 20px;
    margin: 0 auto 25px;
    max-width: 400px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    margin-bottom: 8px;
}
.receipt-row:last-child { margin-bottom: 0; }
.receipt-row span { color: var(--text-muted); }
.receipt-row strong { color: var(--primary-alt); font-family: monospace; font-size: 1.1rem; }

.success-links a {
    color: var(--primary-alt);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
}
.success-links a:hover { text-decoration: underline; }
.success-links a.btn-submit-form {
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.success-links a.btn-submit-form:hover {
    text-decoration: none !important;
}

/* Footer */
.form-footer {
    text-align: center;
    padding-top: 30px;
    color: var(--text-dark);
    font-size: 0.85rem;
}
.footer-links {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--primary); }

/* ADMIN PANEL EXTENSIONS */
.admin-panel-container {
    width: 100%;
}

.admin-nav-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
}

.admin-tab-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--text-muted);
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.admin-tab-btn:hover {
    background: #f8fafc;
    color: var(--text-main);
}

.admin-tab-btn.active {
    background: var(--primary-gradient);
    color: #ffffff;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

.admin-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--shadow-main);
}

.stat-num {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary-alt);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
}

/* Admin Table & Actions */
.admin-table-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.admin-table-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.action-buttons-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-admin-action {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: var(--text-main);
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-admin-action:hover {
    background: #e2e8f0;
}

.btn-admin-action.btn-danger {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fca5a5;
}

.btn-admin-action.btn-danger:hover {
    background: #fee2e2;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th, .admin-table td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.admin-table th {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8fafc;
}

.badge-status {
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-pending { background: #fffbe6; color: #d97706; border: 1px solid #ffe58f; }
.badge-approved { background: #e6fffa; color: #059669; border: 1px solid #87e8de; }
.badge-rejected { background: #fff1f0; color: #dc2626; border: 1px solid #ffa39e; }

.no-applications {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}
.no-applications i {
    font-size: 3rem;
    margin-bottom: 12px;
    color: #cbd5e1;
}

/* Modals */
.admin-login-card {
    max-width: 440px;
    width: 100%;
    text-align: center;
    padding: 35px 30px;
}

.btn-close-modal {
    position: absolute;
    top: 16px; right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
}
.btn-close-modal:hover { color: var(--text-main); }

.admin-login-icon {
    width: 60px; height: 60px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    color: #ffffff;
    font-size: 1.5rem;
    box-shadow: var(--shadow-glow);
}

.admin-login-title {
    font-size: 1.4rem; font-weight: 800; color: var(--text-main); margin-bottom: 6px;
}
.admin-login-desc {
    font-size: 0.88rem; color: var(--text-muted); margin-bottom: 20px;
}

/* Question Manager Modal / Cards */
.q-manager-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.q-item-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.q-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.q-item-title {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.98rem;
}

.q-item-type {
    font-size: 0.78rem;
    color: var(--primary-alt);
    font-weight: 700;
    text-transform: uppercase;
}

.q-item-actions {
    display: flex;
    gap: 6px;
}

/* Modal Detail Cards & Corporate Orange Box System */
.modal-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin-bottom: 15px;
}

.modal-field-card {
    background: #ffffff;
    border: 1.5px solid #fed7aa !important;
    border-radius: var(--radius-md) !important;
    padding: 18px 22px !important;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-field-card:hover {
    border-color: var(--primary) !important;
    transform: translateY(-2px);
}

.modal-field-card.full-width {
    grid-column: 1 / -1;
}

.modal-field-title {
    color: #c2410c !important;
    font-size: 0.94rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-field-value-box {
    background: #fff7ed;
    border: 1px solid #ffedd5;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-main);
    font-size: 0.96rem;
    line-height: 1.65;
    word-break: break-all !important;
    word-wrap: break-word !important;
    overflow-wrap: anywhere !important;
    white-space: pre-wrap !important;
}

.modal-rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffedd5;
    border: 1px solid #fed7aa;
    padding: 4px 12px;
    border-radius: 6px;
    margin: 4px 4px 4px 0;
    font-size: 0.88rem;
    color: #c2410c;
    font-weight: 600;
}
