:root {
            --primary-color: #ff6b35;
            --primary-gradient: linear-gradient(135deg, #ff6b35, #f9a03f);
            --text-color: #333333;
            --text-light: #666666;
            --bg-color: #f8f9fa;
            --input-bg: #ffffff;
            --input-border: #e0e0e0;
            --input-focus: #ff6b35;
            --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
            --transition: all 0.3s ease;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Montserrat', sans-serif;
            background-color: var(--bg-color);
            color: var(--text-color);
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            padding: 20px;
        }

        .registration-container {
            background-color: #fff;
            padding: 40px;
            border-radius: 16px;
            box-shadow: var(--shadow);
            width: 95%;
            max-width: 900px;
            position: relative;
        }

        h2 {
            font-family: 'Montserrat', sans-serif;
            text-align: center;
            margin-bottom: 30px;
            color: var(--text-color);
            font-size: 32px;
            font-weight: 700;
            position: relative;
            padding-bottom: 15px;
            letter-spacing: -0.5px;
        }

        h2:after {
            content: '';
            position: absolute;
            width: 60px;
            height: 3px;
            background: var(--primary-gradient);
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            border-radius: 2px;
        }

        h2 i {
            margin-left: 8px;
            color: var(--primary-color);
        }

        .form-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 25px;
        }

        label {
            display: block;
            margin-bottom: 8px;
            color: var(--text-light);
            font-weight: 500;
            font-size: 14px;
        }

        input, select, textarea {
            width: 100%;
            padding: 14px;
            border: 1px solid var(--input-border);
            border-radius: 8px;
            background-color: var(--input-bg);
            transition: var(--transition);
            font-family: 'Montserrat', sans-serif;
            font-size: 14px;
            font-weight: 400;
            color: var(--text-color);
            box-shadow: 0 2px 5px rgba(0,0,0,0.02);
        }

        input:focus, select:focus, textarea:focus {
            border-color: var(--input-focus);
            outline: none;
            box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
        }

        .profile-section, .id-section {
            margin-top: 25px;
            display: flex;
            align-items: center;
            gap: 30px;
            flex-wrap: wrap;
        }

        .profile-pic img {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            border: 3px solid #fff;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
            object-fit: cover;
        }

        input[type="file"] {
            padding: 12px;
            background: #f8f8f8;
            border-radius: 8px;
            border: 1px dashed var(--input-border);
            cursor: pointer;
        }

        input[type="file"]:hover {
            background: #f0f0f0;
        }

        button {
            margin-top: 40px;
            font-size: 16px;
            width: 100%;
            padding: 16px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            background-image: var(--primary-gradient);
            color: white;
            font-weight: 600;
            letter-spacing: 0.5px;
            transition: var(--transition);
            box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
            font-family: 'Montserrat', sans-serif;
            text-transform: uppercase;
        }

        button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
        }

        button:active {
            transform: translateY(1px);
        }

        .success-message {
            color: #2e7d32;
            font-weight: 500;
            text-align: center;
            padding: 15px;
            margin-bottom: 20px;
            background-color: rgba(46, 125, 50, 0.1);
            border-radius: 8px;
            border-left: 4px solid #2e7d32;
        }

        .error-message {
            color: #d32f2f;
            font-weight: 500;
            text-align: center;
            padding: 15px;
            margin-bottom: 20px;
            background-color: rgba(211, 47, 47, 0.1);
            border-radius: 8px;
            border-left: 4px solid #d32f2f;
        }

        @media (max-width: 600px) {
            .form-grid {
                display: flex;
                flex-direction: column;
                gap: 20px;
            }
            
            .profile-section, .id-section {
                flex-direction: column;
                align-items: flex-start;
            }
            
            .registration-container {
                padding: 25px;
            }
        }

        .name-container {
            display: flex;
            gap: 5px;
        }

        select[name="salutation"] {
            width: 80px !important;
            flex-shrink: 0;
        }

        select {
            appearance: none;
            background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 14px center;
            background-size: 16px;
            padding-right: 40px;
        }

        input[readonly] {
            background-color: #f5f5f5;
            color: var(--primary-color);
            font-weight: 600;
        }

        .file-upload-container {
            width: 100%;
        }

        .file-upload-label {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .file-upload-label i {
            color: var(--primary-color);
        }

        /* Montserrat-specific adjustments */
        input::placeholder {
            font-weight: 300;
            opacity: 0.7;
        }
        
          /* ── Security UI Enhancements ── */
        .field-error {
            color: #e53935;
            font-size: 0.76rem;
            margin-top: 4px;
            display: none;
            align-items: center;
            gap: 5px;
            font-weight: 500;
        }
        .field-error.show { display: flex; }

        input.is-invalid, select.is-invalid { border: 1.5px solid #e53935 !important; background: #fff5f5; }
        input.is-valid,   select.is-valid   { border: 1.5px solid #43a047 !important; background: #f5fff6; }

        /* Password wrapper */
        .pw-wrapper { position: relative; display: flex; align-items: center; }
        .pw-wrapper input {
            padding-right: 40px;
            width: 100%;
            box-sizing: border-box;
        }
        .pw-toggle {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            cursor: pointer;
            color: #aaa;
            background: none;
            border: none;
            font-size: 1.05rem;
            padding: 0;
            line-height: 1;
            z-index: 2;
            pointer-events: all;
        }
        .pw-toggle:hover { color: #555; }

        /* Strength bar */
        .strength-wrap { margin-top: 6px; }
        .strength-bar-bg {
            height: 5px; border-radius: 3px;
            background: #e0e0e0; overflow: hidden;
        }
        .strength-bar {
            height: 100%; width: 0; border-radius: 3px;
            transition: width .3s ease, background .3s ease;
        }
        .strength-text { font-size: 0.72rem; font-weight: 600; margin-top: 3px; }

        .str-1 { width: 25%; background: #e53935; }
        .str-2 { width: 50%; background: #fb8c00; }
        .str-3 { width: 75%; background: #fdd835; }
        .str-4 { width: 100%; background: #43a047; }
        .lbl-1 { color: #e53935; }
        .lbl-2 { color: #fb8c00; }
        .lbl-3 { color: #9a7c00; }
        .lbl-4 { color: #2e7d32; }

        /* File thumb preview */
        .file-thumb-wrap { margin-top: 6px; }
        .file-thumb {
            max-width: 100px; max-height: 75px;
            border-radius: 6px; border: 2px solid #ddd;
            display: none; object-fit: cover;
        }
        .file-info { font-size: 0.74rem; color: #555; margin-top: 3px; display: none; }

        /* Submit button states */
        button[type="submit"].loading { opacity: .7; pointer-events: none; cursor: not-allowed; }
        .btn-spinner {
            display: none; width: 14px; height: 14px;
            border: 2px solid rgba(255,255,255,0.5); border-top-color: #fff;
            border-radius: 50%; animation: spin .7s linear infinite;
            vertical-align: middle; margin-left: 8px;
        }
        .loading .btn-spinner { display: inline-block; }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* Summary error box */
        #form-error-summary {
            background: #fdecea; border: 1px solid #ef9a9a;
            border-radius: 8px; padding: 12px 16px;
            color: #c62828; font-size: 0.84rem;
            margin-bottom: 16px; display: none;
        }
        #form-error-summary ul { margin: 6px 0 0 16px; padding: 0; }