/* ========================================
   Register Page - Additional Styles
   ======================================== */

/* Register Box */
.register-box {
    max-width: 600px;
}

/* Progress Steps */
.progress-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-light);
    color: var(--gray-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
}

.step-label {
    font-size: 0.75rem;
    color: var(--gray-color);
    font-weight: 500;
    transition: var(--transition);
}

.step.active .step-number {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.step.active .step-label {
    color: var(--primary-color);
}

.step.completed .step-number {
    background: var(--success-color);
    color: var(--white);
}

.step.completed .step-label {
    color: var(--success-color);
}

.step-line {
    flex: 1;
    height: 2px;
    background: var(--gray-light);
    margin: 0 0.5rem;
    position: relative;
    top: -10px;
}

/* Step Title */
.step-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-light);
}

.step-title i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Form Steps */
.form-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-step.active {
    display: block;
}

/* Form Row */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 1.5rem;
}

/* Terms and Privacy Checkbox */
.terms-privacy {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--light-color);
    border-radius: 8px;
    margin-top: 1rem;
}

.terms-privacy input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 0.25rem;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.terms-privacy label {
    font-size: 0.875rem;
    color: var(--dark-color);
    cursor: pointer;
    line-height: 1.5;
    margin: 0;
}

.terms-privacy a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.terms-privacy a:hover {
    text-decoration: underline;
}

/* Form Navigation */
.form-navigation,
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    justify-content: space-between;
    align-items: center;
}

.form-actions .btn-prev,
.form-actions .btn-next,
.form-actions #btnSubmit,
.form-navigation .btn-prev,
.form-navigation .btn-next,
.form-navigation #btnSubmit {
    flex: 1 1 0;
    /* remove arbitrary max-width so they can expand */
    max-width: none;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-prev {
    background: var(--white);
    color: var(--primary-color);
}

.btn-prev:hover {
    background: var(--light-color);
    transform: translateX(-5px);
    /* Mantém a cor do texto igual à do botão padrão para evitar sumir sobre fundos claros */
    color: var(--primary-color);
}

.btn-next,
#btnSubmit {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-color: transparent;
}

.btn-next:hover,
#btnSubmit:hover:not(:disabled) {
    transform: translateX(5px);
    box-shadow: var(--shadow-lg);
}

.btn-next:disabled,
.btn-prev:disabled,
#btnSubmit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Button loading and text */
#btnSubmit .btn-text,
#btnSubmit .btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Password Requirements Styling */
.requirements-list {
    background: var(--light-color);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.85rem;
}

.requirements-list h5 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
}

.requirements-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.requirements-list li {
    padding: 0.25rem 0;
    color: var(--gray-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.requirements-list li i {
    font-size: 0.5rem;
}

.requirements-list li.valid {
    color: var(--success-color);
}

.requirements-list li.valid i {
    color: var(--success-color);
}

.requirements-list li.valid i::before {
    content: "\f058"; /* fa-check-circle */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

/* Password Strength */
.password-strength {
    margin-top: 0.5rem;
    height: 4px;
    background: var(--gray-light);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: var(--transition);
    border-radius: 2px;
}

.password-strength-bar.weak {
    width: 33%;
    background: var(--danger-color);
}

.password-strength-bar.medium {
    width: 66%;
    background: #f59e0b;
}

.password-strength-bar.strong {
    width: 100%;
    background: var(--success-color);
}

.password-strength-text {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    color: var(--gray-color);
    display: block;
}

.password-strength-text.weak {
    color: var(--danger-color);
}

.password-strength-text.medium {
    color: #f59e0b;
}

.password-strength-text.strong {
    color: var(--success-color);
}

/* Responsive Adjustments for Register */
@media (max-width: 768px) {
    /* OCULTA completamente a imagem lateral em mobile */
    .login-image-section {
        display: none !important;
    }

    /* Formulário ocupa 100% da tela */
    .login-form-section {
        width: 100%;
        flex: 1;
    }

    .register-box {
        max-width: 100%;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-row .form-group {
        width: 100%;
    }

    .progress-steps {
        padding: 0;
    }

    .step-label {
        font-size: 0.7rem;
    }

    .step-number {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .step-title {
        font-size: 1.1rem;
    }

    .step-title i {
        font-size: 1.25rem;
    }

    .form-navigation,
    .form-actions {
        flex-direction: column;
    }

    .btn-prev,
    .btn-next,
    #btnSubmit {
        max-width: 100%;
        width: 100%;
    }
}

/* Legal modal styles */
.modal-legal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.modal-legal[aria-hidden="true"] { display: none; }
.modal-legal.active { display: flex; }
.modal-legal .modal-legal-content {
    background: #fff;
    padding: 1.5rem;
    width: 90%;
    max-width: 720px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
}
.modal-legal .modal-close {
    float: right;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}
.modal-legal .modal-body { max-height: 50vh; overflow: auto; margin-top: 1rem; }
.modal-legal .modal-actions { margin-top: 1rem; text-align: right; }

@media (max-width: 480px) {
    .step-label {
        display: none;
    }

    .progress-steps {
        justify-content: center;
        gap: 1rem;
    }

    .step-line {
        flex: 0;
        width: 30px;
    }

    .terms-privacy {
        padding: 0.75rem;
    }

    .terms-privacy label {
        font-size: 0.8rem;
    }
}

/* Animation for step transition */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-step.slide-right {
    animation: slideInRight 0.3s ease;
}

.form-step.slide-left {
    animation: slideInLeft 0.3s ease;
}

/* ========================================
   Legal Documents - Terms & Privacy
   ======================================== */

.terms-links {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.2rem;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    margin-bottom: 1rem;
}

.terms-links p {
    margin: 0 0 0.8rem 0;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

.terms-links i.fa-file-contract {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.document-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.document-link {
    flex: 1;
    min-width: 180px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition);
}

.document-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.document-link i {
    font-size: 1rem;
}

.terms-acceptance {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
}

.terms-acceptance input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.terms-acceptance label {
    margin: 0;
    font-weight: 600;
    color: #856404;
    cursor: pointer;
    font-size: 0.9rem;
}

/* ========================================
   Legal Modal Styles
   ======================================== */

.legal-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.legal-modal.active {
    display: block;
}

.legal-modal-content {
    position: relative;
    background-color: white;
    margin: 2% auto;
    width: 90%;
    max-width: 1000px;
    height: 90vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s ease;
}

.legal-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    border-radius: 12px 12px 0 0;
}

.legal-modal-header h2 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

.legal-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.legal-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.legal-modal-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

.legal-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.legal-modal-footer {
    padding: 1rem 2rem;
    border-top: 2px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.legal-modal-footer .btn {
    min-width: 120px;
}

/* Modal Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .legal-modal-content {
        width: 95%;
        height: 95vh;
        margin: 2.5% auto;
    }

    .legal-modal-header {
        padding: 1rem;
    }

    .legal-modal-header h2 {
        font-size: 1.2rem;
    }

    .legal-modal-footer {
        padding: 1rem;
    }

    .document-links {
        flex-direction: column;
    }

    .document-link {
        min-width: 100%;
    }

    .terms-links {
        padding: 1rem;
    }
}

/* ========================================
   Toast Notifications
   ======================================== */

.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    align-items: center;
}

.toast {
    min-width: 300px;
    max-width: 500px;
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    transform: translateY(200px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.hide {
    transform: translateY(200px);
    opacity: 0;
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.3;
}

.toast-message {
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #475569;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 0 12px;
    animation: progress-shrink 5s linear forwards;
}

/* Toast Types - Bootstrap Style */
.toast.success {
    background: #d1fae5;
    border-left-color: #10b981;
    color: #065f46;
}

.toast.success .toast-icon {
    background: #10b981;
    color: white;
}

.toast.success .toast-title {
    color: #065f46;
}

.toast.success .toast-message {
    color: #047857;
}

.toast.success .toast-close {
    color: #065f46;
}

.toast.success .toast-close:hover {
    background: rgba(5, 95, 70, 0.1);
}

.toast.success .toast-progress {
    background: #10b981;
}

.toast.error,
.toast.danger {
    background: #fee2e2;
    border-left-color: #ef4444;
    color: #991b1b;
}

.toast.error .toast-icon,
.toast.danger .toast-icon {
    background: #ef4444;
    color: white;
}

.toast.error .toast-title,
.toast.danger .toast-title {
    color: #991b1b;
}

.toast.error .toast-message,
.toast.danger .toast-message {
    color: #b91c1c;
}

.toast.error .toast-close,
.toast.danger .toast-close {
    color: #991b1b;
}

.toast.error .toast-close:hover,
.toast.danger .toast-close:hover {
    background: rgba(153, 27, 27, 0.1);
}

.toast.error .toast-progress,
.toast.danger .toast-progress {
    background: #ef4444;
}

.toast.warning {
    background: #fef3c7;
    border-left-color: #f59e0b;
    color: #92400e;
}

.toast.warning .toast-icon {
    background: #f59e0b;
    color: white;
}

.toast.warning .toast-title {
    color: #92400e;
}

.toast.warning .toast-message {
    color: #b45309;
}

.toast.warning .toast-close {
    color: #92400e;
}

.toast.warning .toast-close:hover {
    background: rgba(146, 64, 14, 0.1);
}

.toast.warning .toast-progress {
    background: #f59e0b;
}

.toast.info {
    background: #dbeafe;
    border-left-color: #3b82f6;
    color: #1e40af;
}

.toast.info .toast-icon {
    background: #3b82f6;
    color: white;
}

.toast.info .toast-title {
    color: #1e40af;
}

.toast.info .toast-message {
    color: #1d4ed8;
}

.toast.info .toast-close {
    color: #1e40af;
}

.toast.info .toast-close:hover {
    background: rgba(30, 64, 175, 0.1);
}

.toast.info .toast-progress {
    background: #3b82f6;
}

/* Progress Animation */
@keyframes progress-shrink {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* ========================================
   Validation Feedback
   ======================================== */

/* Invalid Feedback Message */
.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--danger-color, #dc3545);
    line-height: 1.4;
}

/* Show feedback when field is invalid */
.is-invalid ~ .invalid-feedback,
.form-group .is-invalid ~ .invalid-feedback,
.password-input ~ .invalid-feedback {
    display: block;
}

/* Invalid field styling */
.form-control.is-invalid,
.is-invalid {
    border-color: var(--danger-color, #dc3545) !important;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid:focus,
.is-invalid:focus {
    border-color: var(--danger-color, #dc3545);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Valid field styling */
.form-control.is-valid,
.is-valid {
    border-color: var(--success-color, #28a745) !important;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-valid:focus,
.is-valid:focus {
    border-color: var(--success-color, #28a745);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Checkbox validation */
input[type="checkbox"].is-invalid {
    border-color: var(--danger-color, #dc3545);
}

input[type="checkbox"].is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Terms acceptance validation */
.terms-acceptance .is-invalid + label {
    color: var(--danger-color, #dc3545);
}

.terms-acceptance + .invalid-feedback {
    margin-top: 0.5rem;
    margin-left: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .toast-container {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
        width: 100%;
    }

    .toast-title {
        font-size: 0.9rem;
    }

    .toast-message {
        font-size: 0.8rem;
    }
}
