﻿/* ============================================================
   REGISTER.CSS – custom styles for registration page
   ============================================================ */

/* ----- Container & Card ----- */
.register-container {
    max-width: 600px;
    margin: 2rem auto;
}

.register-card {
    background: white;
    border-radius: 2.5rem;
    box-shadow: 0 30px 50px -20px rgba(30, 40, 30, 0.3);
    padding: 2rem;
}

.register-header {
    text-align: center;
    margin-bottom: 2rem;
}

    .register-header h1 {
        font-size: 2rem;
        font-weight: 600;
        color: #1d3b2f;
    }

    .register-header p {
        color: #657a6e;
    }

/* ----- Tabs ----- */
.tab-container {
    margin-bottom: 1.5rem;
}

.tab-nav {
    display: flex;
    border-bottom: 2px solid #e0d6cc;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.tab-btn {
    padding: 0.7rem 1.5rem;
    border: none;
    background: transparent;
    color: #8f9e95;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

    .tab-btn:hover {
        color: #2f4a3b;
    }

    .tab-btn.active {
        color: #3b5e4a;
        border-bottom-color: #3b5e4a;
    }

    .tab-btn .tab-badge {
        display: inline-block;
        background: #e0d6cc;
        color: #8f9e95;
        border-radius: 50%;
        padding: 0.1rem 0.6rem;
        font-size: 0.75rem;
        margin-left: 0.3rem;
    }

    .tab-btn.active .tab-badge {
        background: #3b5e4a;
        color: white;
    }

.tab-content {
    display: none;
    animation: fadeSlide 0.3s ease;
}

    .tab-content.active {
        display: block;
    }

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----- Form Navigation ----- */
.form-navigation {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.btn-next,
.btn-prev {
    padding: 0.6rem 2rem;
    border-radius: 30px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
}

.btn-next {
    background: #3b5e4a;
    color: white;
    margin-left: auto;
}

    .btn-next:hover {
        background: #2f4f3c;
        transform: scale(1.02);
    }

.btn-prev {
    background: #e8ecea;
    color: #2f4a3b;
}

    .btn-prev:hover {
        background: #d5dbd8;
    }

/* ----- Attachment Section ----- */
.attachment-section {
    border: 2px dashed #cdbfb0;
    border-radius: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: #faf8f6;
    transition: all 0.3s ease;
}

    .attachment-section:hover {
        border-color: #3b5e4a;
        background: #f5f3f0;
    }

    .attachment-section h4 {
        color: #2f4a3b;
        margin-bottom: 0.5rem;
        font-weight: 600;
    }

    .attachment-section .file-info {
        color: #8f9e95;
        font-size: 0.85rem;
        margin-top: 0.3rem;
    }

    .attachment-section .file-input-wrapper {
        position: relative;
        margin-top: 0.5rem;
    }

        .attachment-section .file-input-wrapper input[type="file"] {
            display: none;
        }

        .attachment-section .file-input-wrapper .file-label {
            display: inline-block;
            padding: 0.5rem 1.5rem;
            background: #3b5e4a;
            color: white;
            border-radius: 30px;
            cursor: pointer;
            transition: all 0.2s;
            font-weight: 500;
        }

            .attachment-section .file-input-wrapper .file-label:hover {
                background: #2f4f3c;
                transform: scale(1.02);
            }

            .attachment-section .file-input-wrapper .file-label i {
                margin-right: 0.5rem;
            }

    .attachment-section .file-name {
        display: inline-block;
        margin-left: 1rem;
        color: #2f4a3b;
        font-weight: 500;
    }

    .attachment-section .file-remove {
        color: #e74c3c;
        cursor: pointer;
        margin-left: 0.5rem;
        font-weight: 600;
        display: none;
    }

        .attachment-section .file-remove:hover {
            text-decoration: underline;
        }

    .attachment-section .file-upload-hint {
        color: #8f9e95;
        font-size: 0.8rem;
        margin-top: 0.3rem;
    }

/* ----- Checkbox Wrapper ----- */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.3rem 0;
}

    .checkbox-wrapper .form-check-input {
        width: 1.2rem;
        height: 1.2rem;
        accent-color: #3b5e4a;
        cursor: pointer;
        margin: 0;
    }

    .checkbox-wrapper .form-check-label {
        font-weight: 500;
        color: #2f4a3b;
        cursor: pointer;
        margin: 0;
        font-size: 0.95rem;
    }

.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: #3b5e4a;
    cursor: pointer;
}

/* ----- Form Inputs ----- */
.register-input {
    width: 100%;
    padding: 0.6rem 1.2rem;
    border: 1px solid #cdbfb0;
    border-radius: 30px;
    font-size: 1rem;
    background: white;
    outline: none;
    min-height: 48px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .register-input:focus {
        border-color: #3b5e4a !important;
        box-shadow: 0 0 0 2px rgba(59, 94, 74, 0.2);
    }

.form-group {
    margin-bottom: 1.2rem;
}

    .form-group label {
        display: block;
        font-weight: 500;
        color: #2f4a3b;
        margin-bottom: 0.3rem;
    }

/* ----- Password ----- */
.password-wrapper {
    position: relative;
}

    .password-wrapper .register-input {
        padding-right: 3rem;
    }

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #7b8d81;
}

/* ----- Contact ----- */
.contact-wrapper {
    display: flex;
    gap: 0.3rem;
    align-items: stretch;
}

    .contact-wrapper .phone-input {
        flex: 1;
    }

/* ----- Custom Dropdown (Country Code) ----- */
.custom-dropdown {
    position: relative;
    flex-shrink: 0;
    width: 210px;
}

.custom-dropdown-display {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid #cdbfb0;
    border-radius: 30px;
    cursor: pointer;
    background: white;
    min-height: 48px;
    font-size: 1rem;
    line-height: 1.4;
    transition: border-color 0.2s;
}

    .custom-dropdown-display:hover {
        border-color: #3b5e4a;
    }

.custom-dropdown select {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 16px;
}

    .custom-dropdown select:focus + .custom-dropdown-display {
        border-color: #3b5e4a;
        box-shadow: 0 0 0 2px rgba(59, 94, 74, 0.2);
    }

/* ----- Flag Icon ----- */
.fi {
    font-size: 1.4rem;
    line-height: 1;
    vertical-align: middle;
    border-radius: 2px;
}

/* ----- Submit Button ----- */
.btn-register {
    width: 100%;
    background: #3b5e4a;
    color: white;
    border: 1px solid #2d4737;
    border-radius: 40px;
    padding: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

    .btn-register:hover:not(:disabled) {
        background: #2f4f3c;
        transform: scale(1.02);
    }

    .btn-register:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

/* ----- Divider ----- */
.register-divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
}

    .register-divider hr {
        flex: 1;
        border: none;
        border-top: 1px dashed #e0d6cc;
    }

    .register-divider span {
        padding: 0 1rem;
        color: #8f9e95;
    }

/* ----- Error Messages ----- */
.error-message {
    font-size: 0.8rem;
    font-weight: normal;
    color: #e74c3c;
    display: none;
}

.text-muted {
    color: #8f9e95 !important;
    font-weight: normal;
    font-size: 0.85rem;
}

.text-danger {
    color: #e74c3c !important;
}

/* ----- Error State for Fields ----- */
.register-input.error,
.register-input.error:focus {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2) !important;
    background-color: #fff5f5;
}

/* ----- Select2 Custom Styling ----- */
.select2-container--default .select2-selection--single {
    border-radius: 30px !important;
    border: 1px solid #cdbfb0 !important;
    min-height: 48px !important;
    background: white !important;
    outline: none !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 48px !important;
        padding-left: 1.2rem !important;
        color: #2f4a3b !important;
        font-size: 1rem !important;
    }

    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 48px !important;
        right: 0.8rem !important;
    }

        .select2-container--default .select2-selection--single .select2-selection__arrow b {
            border-color: #8f9e95 transparent transparent transparent !important;
        }

    .select2-container--default .select2-selection--single:hover {
        border-color: #3b5e4a !important;
    }

.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #3b5e4a !important;
    box-shadow: 0 0 0 2px rgba(59, 94, 74, 0.2) !important;
}

.select2-dropdown {
    border-radius: 15px !important;
    border-color: #cdbfb0 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #3b5e4a !important;
    color: white !important;
}

.select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: #e8ecea !important;
    color: #2f4a3b !important;
}

.select2-search--dropdown .select2-search__field {
    border-radius: 30px !important;
    border: 1px solid #cdbfb0 !important;
    padding: 0.5rem 1rem !important;
    min-height: 40px !important;
}

    .select2-search--dropdown .select2-search__field:focus {
        border-color: #3b5e4a !important;
        box-shadow: 0 0 0 2px rgba(59, 94, 74, 0.2) !important;
        outline: none !important;
    }

/* Select2 Error State */
.select2-container--default .select2-selection--single.error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2) !important;
    background-color: #fff5f5 !important;
}

    .select2-container--default .select2-selection--single.error .select2-selection__rendered {
        color: #e74c3c !important;
    }

/* ----- Choose Company Button ----- */
.btn-choose-company {
    background: #3b5e4a;
    color: white;
    border: none;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

    .btn-choose-company:hover {
        background: #2f4f3c;
        transform: scale(1.03);
    }

    .btn-choose-company:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

.btn-clear-company {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

    .btn-clear-company:hover {
        background: #c0392b;
        transform: scale(1.03);
    }

.company-selected-info {
    background: #e8f0ec;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border-left: 4px solid #3b5e4a;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

    .company-selected-info .text-success {
        color: #2e7d32 !important;
    }

    .company-selected-info .text-muted {
        font-size: 0.85rem;
    }

/* Company selection disabled state */
.register-input.company-selected {
    background-color: #f0f4f2 !important;
    cursor: not-allowed;
    opacity: 0.8;
}

/* ----- Modal Table Styles ----- */
#companyTable {
    font-size: 0.95rem;
}

    #companyTable thead th {
        background: #f8f6f4;
        border-bottom: 2px solid #cdbfb0;
        color: #2f4a3b;
        font-weight: 600;
        padding: 0.75rem 0.5rem;
        position: sticky;
        top: 0;
        z-index: 1;
    }

    #companyTable tbody td {
        padding: 0.6rem 0.5rem;
        vertical-align: middle;
        border-bottom: 1px solid #e8e4e0;
    }

    #companyTable tbody tr {
        transition: background 0.15s ease;
        cursor: pointer;
    }

        #companyTable tbody tr:hover {
            background: #f0f4f2;
        }

        #companyTable tbody tr.company-row-selected {
            background: #d4e8dc !important;
        }

.btn-select-company {
    background: #3b5e4a;
    color: white;
    border: none;
    padding: 0.2rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .btn-select-company:hover {
        background: #2f4f3c;
        transform: scale(1.05);
    }

    .btn-select-company:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* Responsive modal */
@media (max-width: 576px) {
    #companyTable {
        font-size: 0.8rem;
    }

        #companyTable thead th,
        #companyTable tbody td {
            padding: 0.4rem 0.3rem;
        }

    .btn-select-company {
        font-size: 0.7rem;
        padding: 0.1rem 0.6rem;
    }
}

/* ----- Responsive ----- */
@media (max-width: 576px) {
    .register-card {
        padding: 1.5rem;
    }

    .custom-dropdown {
        width: 140px;
    }

    .register-input {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .btn-register {
        font-size: 1rem;
        padding: 0.7rem;
    }

    .tab-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

        .tab-btn .tab-badge {
            font-size: 0.65rem;
            padding: 0.05rem 0.4rem;
        }
}

/* ----- Loading Spinner for Register Button ----- */
.btn-register.loading {
    opacity: 0.8;
    cursor: wait;
}

.btn-register .spinner-border {
    margin-right: 0.5rem;
    width: 1rem;
    height: 1rem;
    border-width: 0.15rem;
}

#emailAvailabilityMessage {
    font-size: 0.85rem;
    font-weight: normal;
    display: none;
}

#emailCheckingSpinner {
    color: #3b5e4a;
    font-size: 1rem;
}

/* ============================================================
   AUTH PAGES — ForgotPassword, VerifyResetCode, ResetPassword
   ============================================================ */

/* Narrow centred container for auth forms */
.auth-container {
    max-width: 520px;
    margin: 3rem auto;
    padding: 0 1rem;
}

/* Primary action button */
.btn-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: linear-gradient(180deg, #3b5e4a 0%, #2f4f3c 100%);
    color: #ffffff;
    border: none;
    border-radius: 40px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    margin-top: 1.25rem;
    box-shadow: 0 6px 16px -8px rgba(59, 94, 74, 0.55);
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

    .btn-save:hover:not(:disabled) {
        background: linear-gradient(180deg, #46715a 0%, #355942 100%);
        transform: translateY(-1px);
        box-shadow: 0 10px 22px -8px rgba(59, 94, 74, 0.7);
    }

    .btn-save:active:not(:disabled) {
        transform: translateY(0);
        box-shadow: 0 4px 10px -4px rgba(59, 94, 74, 0.6);
    }

    .btn-save:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(59, 94, 74, 0.25), 0 10px 22px -8px rgba(59, 94, 74, 0.7);
    }

    .btn-save:disabled,
    .btn-save.loading {
        opacity: 0.55;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

    .btn-save .spinner-border {
        width: 1rem;
        height: 1rem;
        border-width: 0.15rem;
        margin-right: 0.4rem;
    }

/* Secondary / back link */
.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border-radius: 30px;
    color: #3b5e4a;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

    .auth-back-link:hover {
        background: #e8f0ec;
        color: #1d3b2f;
        text-decoration: none;
    }

/* Centred 6-digit code input */
.code-input {
    text-align: center;
    letter-spacing: 0.5rem;
    text-indent: 0.5rem; /* keeps the digits visually centred */
    font-size: 1.5rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Muted info paragraph */
.auth-info {
    color: #657a6e;
    font-size: 0.95rem;
    line-height: 1.55;
    text-align: center;
    margin: 0;
}